.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/Mohr_circles.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_Mohr_circles.py: =========================================================== Draw Mohr circles of stress tensor =========================================================== This example shows how to automatically draw the Mohr circles from a given stress tensor. .. GENERATED FROM PYTHON SOURCE LINES 9-11 Create a random stress tensor ------------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 11-15 .. code-block:: Python from elasticipy.tensors.stress_strain import StressTensor s = StressTensor.rand(seed=123) # Use seed to ensure reproducibility print(s) .. rst-class:: sphx-glr-script-out .. code-block:: none Stress tensor [[0.68235186 0.11909641 0.57185244] [0.11909641 0.1759059 0.54433445] [0.57185244 0.54433445 0.81975456]] .. GENERATED FROM PYTHON SOURCE LINES 16-18 Draw the corresponding Mohr circles ---------------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 18-21 .. code-block:: Python fig, ax = s.draw_Mohr_circles() .. image-sg:: /auto_examples/images/sphx_glr_Mohr_circles_001.png :alt: Mohr circles :srcset: /auto_examples/images/sphx_glr_Mohr_circles_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.104 seconds) .. _sphx_glr_download_auto_examples_Mohr_circles.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: Mohr_circles.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: Mohr_circles.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: Mohr_circles.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_