.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "api/gallery/structural_engineering/beams/plot_02_navier_beam.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_beams_plot_02_navier_beam.py: Navier's beam theory (1826) =========================== Navier's 1826 lectures at the École des ponts et chaussées put beam theory in its modern form: plane sections stay plane, the neutral axis passes through the centroid, the stress is :math:`\sigma = My/I` (:func:`~engineeringkit.structural_engineering.bending_stress`) and the curvature is :math:`y'' = M/(EI)`. The example loads a steel beam (:class:`~engineeringkit.structural_engineering.SimplySupportedBeam`), checks the midspan deflection :math:`5wL^4/(384EI)`, and checks that the stress profile carries no net force and exactly the applied moment. .. GENERATED FROM PYTHON SOURCE LINES 16-22 .. code-block:: Python import matplotlib.pyplot as plt import numpy as np from scipy.integrate import simpson from engineeringkit.structural_engineering import SimplySupportedBeam, bending_stress, rectangular_second_moment .. GENERATED FROM PYTHON SOURCE LINES 23-25 Shear, moment and deflection ---------------------------- .. GENERATED FROM PYTHON SOURCE LINES 25-40 .. code-block:: Python L, E, w = 6.0, 200e9, 8e3 b, h = 0.10, 0.30 I = rectangular_second_moment(b, h) result = SimplySupportedBeam(L, E, I).solve_uniform_load(w, n=601) summary = result.summary() print(f"max moment {summary['max_abs_moment'] / 1e3:.1f} kN m, midspan deflection {1e3 * summary['max_abs_deflection']:.2f} mm") assert np.isclose(summary["max_abs_moment"], w * L**2 / 8) assert np.isclose(summary["max_abs_deflection"], 5 * w * L**4 / (384 * E * I)) fig, axes = result.plot() for ax, label in zip(axes, ["shear [N]", "moment [N m]", "deflection [m]"]): ax.set_ylabel(label) fig.tight_layout() .. image-sg:: /api/gallery/structural_engineering/beams/images/sphx_glr_plot_02_navier_beam_001.png :alt: plot 02 navier beam :srcset: /api/gallery/structural_engineering/beams/images/sphx_glr_plot_02_navier_beam_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none max moment 36.0 kN m, midspan deflection 3.00 mm .. GENERATED FROM PYTHON SOURCE LINES 41-45 The stress across the midspan section ------------------------------------- With ``y`` measured downward, a sagging moment puts the bottom in tension. .. GENERATED FROM PYTHON SOURCE LINES 45-63 .. code-block:: Python M = summary["max_abs_moment"] y = np.linspace(-h / 2, h / 2, 401) sigma = bending_stress(M, y, I) net_force = simpson(sigma * b, x=y) resisting_moment = simpson(sigma * b * y, x=y) print(f"peak stress {sigma.max() / 1e6:.1f} MPa, net force {net_force:.2e} N, moment {resisting_moment / 1e3:.1f} kN m") assert abs(net_force) < 1e-6 * M / h assert np.isclose(resisting_moment, M) fig, ax = plt.subplots(figsize=(4, 4)) ax.plot(sigma / 1e6, y * 1e3) ax.axvline(0, color="gray", lw=0.5) ax.invert_yaxis() ax.set(xlabel="stress [MPa]", ylabel="depth below neutral axis [mm]", title="Midspan section") fig.tight_layout() plt.show() .. image-sg:: /api/gallery/structural_engineering/beams/images/sphx_glr_plot_02_navier_beam_002.png :alt: Midspan section :srcset: /api/gallery/structural_engineering/beams/images/sphx_glr_plot_02_navier_beam_002.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none peak stress 24.0 MPa, net force 0.00e+00 N, moment 36.0 kN m .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.063 seconds) .. _sphx_glr_download_api_gallery_structural_engineering_beams_plot_02_navier_beam.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/beams/plot_02_navier_beam.ipynb :alt: Launch JupyterLite :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_02_navier_beam.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_02_navier_beam.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_02_navier_beam.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_