.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "api/gallery/structural_engineering/stress/plot_02_strain_gauge_rosette.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_structural_engineering_stress_plot_02_strain_gauge_rosette.py: Simmons and Ruge's bonded strain gauge (1938) ============================================= Stress cannot be measured, only strain. In 1936 Edward Simmons at Caltech, and in April 1938 Arthur Ruge at MIT, independently cemented fine resistance wire to a specimen, so that its resistance changed with the strain of the surface beneath; their names became the "SR-4" gauge. One gauge measures strain in one direction; a *rosette* of three at known angles gives the whole plane strain state (:func:`~engineeringkit.structural_engineering.strain_rosette`), and Hooke's law turns it into stress (:func:`~engineeringkit.structural_engineering.plane_stress_from_strains`). The example simulates a rosette on a shaft under bending and torsion and recovers the torque from the three readings. .. GENERATED FROM PYTHON SOURCE LINES 19-25 .. code-block:: Python import matplotlib.pyplot as plt import numpy as np from engineeringkit.structural_engineering import mohr_circle, plane_stress_from_strains, strain_rosette from engineeringkit.structural_engineering.visualizers import plot_mohr_circle .. GENERATED FROM PYTHON SOURCE LINES 26-28 Readings of a 0-45-90 rosette on a shaft surface ------------------------------------------------ .. GENERATED FROM PYTHON SOURCE LINES 28-39 .. code-block:: Python E, nu, G = 200e9, 0.3, 200e9 / 2.6 d, M, T = 0.05, 1.2e3, 2.0e3 sx, txy = 32 * M / (np.pi * d**3), 16 * T / (np.pi * d**3) ex, ey, gxy = sx / E, -nu * sx / E, txy / G angles = np.radians([0.0, 45.0, 90.0]) readings = ex * np.cos(angles) ** 2 + ey * np.sin(angles) ** 2 + gxy * np.sin(angles) * np.cos(angles) rng = np.random.default_rng(1938) noisy = readings + rng.normal(0, 2e-6, 3) # a few microstrain of noise print("gauge readings [microstrain]:", np.round(noisy * 1e6, 1)) .. rst-class:: sphx-glr-script-out .. code-block:: none gauge readings [microstrain]: [ 490. 702.8 -146.5] .. GENERATED FROM PYTHON SOURCE LINES 40-42 Back to stress and torque ------------------------- .. GENERATED FROM PYTHON SOURCE LINES 42-58 .. code-block:: Python strains = strain_rosette(noisy, angles) stress = plane_stress_from_strains(*strains, E, nu) torque = stress[2] * np.pi * d**3 / 16 print(f"recovered: sigma_x {stress[0] / 1e6:.1f} MPa (true {sx / 1e6:.1f}), tau_xy {stress[2] / 1e6:.1f} MPa (true {txy / 1e6:.1f})") print(f"torque {torque:.0f} N m (applied {T:.0f} N m)") exact = plane_stress_from_strains(*strain_rosette(readings, angles), E, nu) assert np.allclose(exact, (sx, 0.0, txy), atol=1e-3 * sx) assert abs(torque - T) < 0.05 * T _, radius, s1, s2 = mohr_circle(*stress) print(f"principal stresses {s1 / 1e6:.1f} and {s2 / 1e6:.1f} MPa") ax = plot_mohr_circle(*stress) ax.set_title("Stress from a strain-gauge rosette") plt.show() .. image-sg:: /api/gallery/structural_engineering/stress/images/sphx_glr_plot_02_strain_gauge_rosette_001.png :alt: Stress from a strain-gauge rosette :srcset: /api/gallery/structural_engineering/stress/images/sphx_glr_plot_02_strain_gauge_rosette_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none recovered: sigma_x 98.0 MPa (true 97.8), tau_xy 81.7 MPa (true 81.5) torque 2005 N m (applied 2000 N m) principal stresses 144.3 and -46.2 MPa .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.055 seconds) .. _sphx_glr_download_api_gallery_structural_engineering_stress_plot_02_strain_gauge_rosette.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/structural_engineering/stress/plot_02_strain_gauge_rosette.ipynb :alt: Launch JupyterLite :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_02_strain_gauge_rosette.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_02_strain_gauge_rosette.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_02_strain_gauge_rosette.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_