.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "api/gallery/materials/plasticity/plot_03_hall_petch.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_03_hall_petch.py: Hall and Petch: grain-size strengthening (1951-1953) ==================================================== Eric Hall (1951) measured the lower yield stress of mild steels with different grain sizes, and Norman Petch (1953) the cleavage strength of iron. Both found the strength rising linearly with :math:`d^{-1/2}`, :math:`\sigma_y = \sigma_0 + k\,d^{-1/2}` (:func:`~engineeringkit.materials.hall_petch`). Dislocations pile up against grain boundaries, and the stress concentrated at the head of a pile-up of length :math:`d` grows as :math:`\sqrt d`; slip crosses into the next grain when it reaches a fixed value. Grain refinement is the only strengthening mechanism that also makes steel tougher. .. GENERATED FROM PYTHON SOURCE LINES 17-22 .. code-block:: Python import matplotlib.pyplot as plt import numpy as np from engineeringkit.materials import hall_petch .. GENERATED FROM PYTHON SOURCE LINES 23-30 Fitting the Hall-Petch line --------------------------- Yield strengths of a mild steel, :math:`\sigma_0 = 70` MPa and :math:`k = 0.74` MPa :math:`\sqrt{m}`, measured with 5 MPa scatter at grain sizes from 2 to 200 micrometres. A straight-line fit in :math:`d^{-1/2}` recovers both constants. .. GENERATED FROM PYTHON SOURCE LINES 30-39 .. code-block:: Python sigma0, k = 70e6, 0.74e6 d = np.geomspace(2e-6, 200e-6, 12) rng = np.random.default_rng(2) measured = hall_petch(sigma0, k, d) + rng.normal(0, 5e6, d.size) k_fit, sigma0_fit = np.polyfit(d**-0.5, measured, 1) print(f"fitted sigma_0 = {sigma0_fit / 1e6:.1f} MPa, k = {k_fit / 1e6:.3f} MPa sqrt(m)") assert abs(k_fit / k - 1) < 0.05 and abs(sigma0_fit - sigma0) < 10e6 .. rst-class:: sphx-glr-script-out .. code-block:: none fitted sigma_0 = 71.8 MPa, k = 0.734 MPa sqrt(m) .. GENERATED FROM PYTHON SOURCE LINES 40-46 How much refinement buys ------------------------ Going from a 50 um to a 5 um grain more than doubles the yield strength of this steel. Below about 20 nm the trend reverses as grain boundaries start to slide, and the relation is not used there. .. GENERATED FROM PYTHON SOURCE LINES 46-63 .. code-block:: Python coarse, fine = hall_petch(sigma0, k, 50e-6), hall_petch(sigma0, k, 5e-6) print(f"50 um: {coarse / 1e6:.0f} MPa; 5 um: {fine / 1e6:.0f} MPa") assert fine > 2 * coarse fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(9.5, 3.8)) x = np.linspace(0, d.min() ** -0.5, 2) ax1.plot(d**-0.5 / 1e3, measured / 1e6, "o", label="tests") ax1.plot(x / 1e3, (sigma0_fit + k_fit * x) / 1e6, label="fit") ax1.set(xlabel="d^-1/2 [mm^-1/2]", ylabel="yield strength [MPa]", title="Hall-Petch plot") ax1.legend() grains = np.geomspace(1e-6, 1e-3, 100) ax2.semilogx(1e6 * grains, hall_petch(sigma0, k, grains) / 1e6) ax2.set(xlabel="grain size [um]", ylabel="yield strength [MPa]", title="Mild steel") fig.tight_layout() plt.show() .. image-sg:: /api/gallery/materials/plasticity/images/sphx_glr_plot_03_hall_petch_001.png :alt: Hall-Petch plot, Mild steel :srcset: /api/gallery/materials/plasticity/images/sphx_glr_plot_03_hall_petch_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none 50 um: 175 MPa; 5 um: 401 MPa .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.066 seconds) .. _sphx_glr_download_api_gallery_materials_plasticity_plot_03_hall_petch.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_03_hall_petch.ipynb :alt: Launch JupyterLite :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_03_hall_petch.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_03_hall_petch.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_03_hall_petch.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_