.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "api/gallery/volcanology/plot_14_shaw_magma_viscosity.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 or to run this example in your browser via JupyterLite. .. rst-class:: sphx-glr-example-title .. _sphx_glr_api_gallery_volcanology_plot_14_shaw_magma_viscosity.py: Shaw's magma viscosity (1972) ============================= Herbert Shaw found that the logarithm of the viscosity of silicate melts is a straight line in ``1/T`` whose slope depends only on composition, and that the lines for basalt to rhyolite all pass near one point. That makes Shaw's law an Arrhenius law with activation energy ``s * 1e4 * R``. Rhyolite at eruption temperature is about a hundred million times stiffer than basalt. .. GENERATED FROM PYTHON SOURCE LINES 11-31 .. image-sg:: /api/gallery/volcanology/images/sphx_glr_plot_14_shaw_magma_viscosity_001.png :alt: Shaw's lines pivot near 10^4/T = 1.5 :srcset: /api/gallery/volcanology/images/sphx_glr_plot_14_shaw_magma_viscosity_001.png :class: sphx-glr-single-img .. code-block:: Python import matplotlib.pyplot as plt import numpy as np from earthsciencekit.constants import R_GAS from earthsciencekit.volcanology import arrhenius_viscosity, shaw_viscosity temperature = 1e4 / np.linspace(1.4, 10.5, 200) # out to the pivot, far above any magma temperature fig, ax = plt.subplots() for slope, name in [(2.5, "basalt"), (3.2, "andesite"), (4.0, "rhyolite")]: viscosity = shaw_viscosity(temperature, slope) assert np.allclose(arrhenius_viscosity(temperature, shaw_viscosity(1300, slope), slope * 1e4 * R_GAS, 1300), viscosity) ax.semilogy(1e4 / temperature, viscosity, label=f"{name}, s = {slope}") assert shaw_viscosity(1073, 4.0) / shaw_viscosity(1473, 2.5) > 1e7 ax.axvline(1.5, color="0.5", ls=":", lw=1) ax.axvspan(1e4 / 1500, 1e4 / 950, color="0.9", label="magmatic temperatures") ax.set(xlabel="10^4 / T [1/K]", ylabel="viscosity [Pa s]", title="Shaw's lines pivot near 10^4/T = 1.5") ax.legend() plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.139 seconds) .. _sphx_glr_download_api_gallery_volcanology_plot_14_shaw_magma_viscosity.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: lite-badge .. image:: images/jupyterlite_badge_logo.svg :target: ../../../lite/lab/index.html?path=api/gallery/volcanology/plot_14_shaw_magma_viscosity.ipynb :alt: Launch JupyterLite :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_14_shaw_magma_viscosity.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_14_shaw_magma_viscosity.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_14_shaw_magma_viscosity.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_