.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "api/gallery/materials/yield/plot_01_tresca_criterion.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_materials_yield_plot_01_tresca_criterion.py: Tresca's maximum-shear yield criterion (1864) ============================================= Henri Tresca (1864) punched and extruded lead, copper and iron through dies at the Conservatoire des Arts et Métiers and found that metals flow like a viscous fluid once the largest shear stress reaches a constant. With principal stresses :math:`\sigma_1 \ge \sigma_2 \ge \sigma_3` the criterion is :math:`\sigma_1 - \sigma_3 = \sigma_y` (:func:`~engineeringkit.materials.tresca_equivalent`). It is the first criterion for yielding under combined stresses, and in the plane-stress principal plane it draws a hexagon. The example applies it to a shaft in bending and torsion and to biaxial stress states. .. GENERATED FROM PYTHON SOURCE LINES 17-23 .. code-block:: Python import matplotlib.pyplot as plt import numpy as np from engineeringkit.materials import factor_of_safety, tresca_equivalent from engineeringkit.materials.visualizers import plot_yield_surfaces .. GENERATED FROM PYTHON SOURCE LINES 24-31 A shaft in bending and torsion ------------------------------ At the surface of a shaft the bending stress :math:`\sigma` and the torsional shear :math:`\tau` give principal stresses :math:`\sigma/2 \pm \sqrt{(\sigma/2)^2 + \tau^2}` and zero. Tresca's equivalent stress is their spread, :math:`\sqrt{\sigma^2 + 4\tau^2}`. .. GENERATED FROM PYTHON SOURCE LINES 31-41 .. code-block:: Python sy = 350e6 sigma, tau = 120e6, 90e6 center, radius = sigma / 2, np.hypot(sigma / 2, tau) principal = [center + radius, center - radius, 0.0] equivalent = tresca_equivalent(principal) print(f"principal stresses {np.round(np.array(principal) / 1e6, 1)} MPa") print(f"Tresca equivalent {equivalent / 1e6:.1f} MPa, safety factor {factor_of_safety(sy, equivalent):.2f}") assert np.isclose(equivalent, np.sqrt(sigma**2 + 4 * tau**2)) .. rst-class:: sphx-glr-script-out .. code-block:: none principal stresses [168.2 -48.2 0. ] MPa Tresca equivalent 216.3 MPa, safety factor 1.62 .. GENERATED FROM PYTHON SOURCE LINES 42-48 Where the zero stress matters ----------------------------- When both in-plane principal stresses have the same sign, the largest shear acts out of the plane and the zero third stress sets the spread. Equal biaxial tension yields at :math:`\sigma_y`, not at infinity. .. GENERATED FROM PYTHON SOURCE LINES 48-60 .. code-block:: Python states = np.array([[1.0, 1.0, 0.0], [1.0, 0.5, 0.0], [1.0, -1.0, 0.0], [0.5, -0.5, 0.0]]) * sy for state, eq in zip(states, tresca_equivalent(states)): print(f"sigma_1, sigma_2 = {state[0] / sy:+.1f}, {state[1] / sy:+.1f} sigma_y -> Tresca {eq / sy:.2f} sigma_y") np.testing.assert_allclose(tresca_equivalent(states) / sy, [1, 1, 2, 1]) ax = plot_yield_surfaces(sy) ax.plot(states[:, 0] / sy, states[:, 1] / sy, "ko") ax.set_title("Tresca's hexagon") ax.figure.tight_layout() plt.show() .. image-sg:: /api/gallery/materials/yield/images/sphx_glr_plot_01_tresca_criterion_001.png :alt: Tresca's hexagon :srcset: /api/gallery/materials/yield/images/sphx_glr_plot_01_tresca_criterion_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none sigma_1, sigma_2 = +1.0, +1.0 sigma_y -> Tresca 1.00 sigma_y sigma_1, sigma_2 = +1.0, +0.5 sigma_y -> Tresca 1.00 sigma_y sigma_1, sigma_2 = +1.0, -1.0 sigma_y -> Tresca 2.00 sigma_y sigma_1, sigma_2 = +0.5, -0.5 sigma_y -> Tresca 1.00 sigma_y .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.027 seconds) .. _sphx_glr_download_api_gallery_materials_yield_plot_01_tresca_criterion.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/materials/yield/plot_01_tresca_criterion.ipynb :alt: Launch JupyterLite :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_01_tresca_criterion.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_01_tresca_criterion.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_01_tresca_criterion.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_