.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "api/gallery/structural_engineering/plot_structural_engineering_benchmark.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_plot_structural_engineering_benchmark.py: Buckling and effective length ============================= For an ideal elastic column the critical load scales as inverse length squared. The pinned and cantilever curves differ through the effective length factor. .. GENERATED FROM PYTHON SOURCE LINES 8-26 .. image-sg:: /api/gallery/structural_engineering/images/sphx_glr_plot_structural_engineering_benchmark_001.png :alt: plot structural engineering benchmark :srcset: /api/gallery/structural_engineering/images/sphx_glr_plot_structural_engineering_benchmark_001.png :class: sphx-glr-single-img .. code-block:: Python import matplotlib.pyplot as plt import numpy as np from engineeringkit.structural_engineering import euler_buckling_load length = np.linspace(0.5, 4, 100) fig, ax = plt.subplots() for K, label in [(1, "pinned"), (2, "cantilever")]: loads = [euler_buckling_load(200e9, 1e-6, L, K) for L in length] ax.plot(length, np.array(loads) / 1000, label=label) p1 = euler_buckling_load(200e9, 1e-6, 1) p2 = euler_buckling_load(200e9, 1e-6, 2) assert np.isclose(p1 / p2, 4) ax.set(xlabel="column length [m]", ylabel="critical load [kN]") ax.legend() plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.103 seconds) .. _sphx_glr_download_api_gallery_structural_engineering_plot_structural_engineering_benchmark.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/plot_structural_engineering_benchmark.ipynb :alt: Launch JupyterLite :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_structural_engineering_benchmark.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_structural_engineering_benchmark.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_structural_engineering_benchmark.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_