.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "api/gallery/materials/plasticity/plot_02_ramberg_osgood.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_plasticity_plot_02_ramberg_osgood.py: Ramberg and Osgood's stress-strain curve (1943) =============================================== Aluminium alloys have no sharp yield point: their stress-strain curves bend over smoothly, and aircraft designers of the Second World War needed them in a form they could compute with. Walter Ramberg and William Osgood (NACA, 1943) described the whole curve with three numbers, :math:`\varepsilon = \sigma/E + K(\sigma/E)^n`, usually written today with the 0.2% offset yield strength, :math:`\varepsilon = \sigma/E + 0.002(\sigma/\sigma_y)^n` (:func:`~engineeringkit.materials.ramberg_osgood_strain`). The example plots the family and recovers the offset yield strength from a sampled curve. .. GENERATED FROM PYTHON SOURCE LINES 18-23 .. code-block:: Python import matplotlib.pyplot as plt import numpy as np from engineeringkit.materials import StressStrainCurve, ramberg_osgood_strain .. GENERATED FROM PYTHON SOURCE LINES 24-28 Ramberg and Osgood's form and the offset form --------------------------------------------- The two forms are the same curve with :math:`K = 0.002(E/\sigma_y)^n`. .. GENERATED FROM PYTHON SOURCE LINES 28-35 .. code-block:: Python E, sy = 72e9, 345e6 stress = np.linspace(0, 1.15 * sy, 400) n = 15 K = 0.002 * (E / sy) ** n assert np.allclose(ramberg_osgood_strain(stress, E, sy, n), stress / E + K * (stress / E) ** n) .. GENERATED FROM PYTHON SOURCE LINES 36-43 The 0.2% offset yield strength ------------------------------ Draw the elastic line shifted by 0.002 strain; it crosses the curve at :math:`\sigma_y`. :meth:`~engineeringkit.materials.StressStrainCurve.offset_yield_strength` does this on sampled data. Smaller :math:`n` means more gradual yielding and more hardening after it. .. GENERATED FROM PYTHON SOURCE LINES 43-59 .. code-block:: Python fig, ax = plt.subplots(figsize=(6, 3.8)) for exponent in (5, 10, 20, 50): curve = StressStrainCurve(ramberg_osgood_strain(stress, E, sy, exponent), stress) found = curve.offset_yield_strength() print(f"n = {exponent:2d}: offset yield {found / 1e6:.1f} MPa") assert np.isclose(found, sy, rtol=5e-3) curve.plot(ax=ax) ax.lines[-1].set_label(f"n = {exponent}") offset = np.linspace(0.002, 0.002 + 1.15 * sy / E, 2) ax.plot(offset, E * (offset - 0.002) / 1e6, "k:", lw=1, label="0.2% offset line") ax.set(xlim=(0, 0.012), title="Ramberg-Osgood curves, 2024-T3 aluminium") ax.legend() fig.tight_layout() plt.show() .. image-sg:: /api/gallery/materials/plasticity/images/sphx_glr_plot_02_ramberg_osgood_001.png :alt: Ramberg-Osgood curves, 2024-T3 aluminium :srcset: /api/gallery/materials/plasticity/images/sphx_glr_plot_02_ramberg_osgood_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none n = 5: offset yield 345.0 MPa n = 10: offset yield 345.0 MPa n = 20: offset yield 345.0 MPa n = 50: offset yield 345.0 MPa .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.038 seconds) .. _sphx_glr_download_api_gallery_materials_plasticity_plot_02_ramberg_osgood.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/plasticity/plot_02_ramberg_osgood.ipynb :alt: Launch JupyterLite :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_02_ramberg_osgood.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_02_ramberg_osgood.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_02_ramberg_osgood.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_