.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/wave_velocity.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_auto_examples_wave_velocity.py: =========================================================== Compute and plot wave velocities =========================================================== This example shows how to compute the wave velocities from the stiffness tensor, and how to plot them .. GENERATED FROM PYTHON SOURCE LINES 9-14 Define the stiffness tensor for forsterite ------------------------------------- We define the stiffness tensor for a forsterite (taken from `the similar tutorial for MTEX users `_.) as well as the mass density .. GENERATED FROM PYTHON SOURCE LINES 14-21 .. code-block:: Python from elasticipy.tensors.elasticity import StiffnessTensor C = StiffnessTensor.orthorhombic(phase_name='forsterite', C11=320, C12=68.2, C13=71.6, C22=196.5, C23=76.8, C33=233.5, C44=64, C55=77, C66=78.7) rho = 3.36 # kg/dm³! print(C) .. rst-class:: sphx-glr-script-out .. code-block:: none Stiffness tensor (in Voigt mapping): [[320. 68.2 71.6 0. 0. 0. ] [ 68.2 196.5 76.8 0. 0. 0. ] [ 71.6 76.8 233.5 0. 0. 0. ] [ 0. 0. 0. 64. 0. 0. ] [ 0. 0. 0. 0. 77. 0. ] [ 0. 0. 0. 0. 0. 78.7]] Phase: forsterite .. GENERATED FROM PYTHON SOURCE LINES 22-24 Compute the velocities of primary and secondary waves ---------------------------------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 24-26 .. code-block:: Python cp, cs_fast, cs_slow = C.wave_velocity(rho) .. GENERATED FROM PYTHON SOURCE LINES 27-29 Plot them as three independent pole figures: --------------------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 29-36 .. code-block:: Python import matplotlib.pyplot as plt fig = plt.figure(figsize=(20, 5)) cp.plot_as_pole_figure(subplot_args=(131,), title='p wave', fig=fig) cs_fast.plot_as_pole_figure(subplot_args=(132,), title='s wave (fast)', fig=fig) cs_slow.plot_as_pole_figure(subplot_args=(133,), title='s wave (slow)', fig=fig) .. image-sg:: /auto_examples/images/sphx_glr_wave_velocity_001.png :alt: p wave, s wave (fast), s wave (slow) :srcset: /auto_examples/images/sphx_glr_wave_velocity_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none (
, ) .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.402 seconds) .. _sphx_glr_download_auto_examples_wave_velocity.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: wave_velocity.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: wave_velocity.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: wave_velocity.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_