.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "api/gallery/fluid_engineering/hydrostatics/plot_02_stevin_hydrostatic_paradox.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_fluid_engineering_hydrostatics_plot_02_stevin_hydrostatic_paradox.py: Stevin's hydrostatic paradox (1586) =================================== In *De Beghinselen des Waterwichts* (1586) Simon Stevin showed that the force of water on the bottom of a vessel depends only on the depth and the area of the bottom, not on how much water the vessel holds: :math:`p = \rho g h` (:func:`~engineeringkit.fluid_engineering.hydrostatic_pressure`). He went on to find the force on a sloping or vertical wall, the first problem of engineering hydrostatics. This example fills three vessels of different shape to the same depth, then computes the thrust on a dam face and where it acts (:func:`~engineeringkit.fluid_engineering.hydrostatic_force_plane`, :func:`~engineeringkit.fluid_engineering.center_of_pressure_depth`). .. GENERATED FROM PYTHON SOURCE LINES 17-28 .. code-block:: Python import matplotlib.pyplot as plt import numpy as np from engineeringkit.fluid_engineering import ( G, center_of_pressure_depth, hydrostatic_force_plane, hydrostatic_pressure, pressure_head, ) .. GENERATED FROM PYTHON SOURCE LINES 29-35 Three vessels, one base force ----------------------------- Each vessel has a 0.01 m² base and holds water 0.5 m deep. A flared vessel holds five times the water of a narrow-necked one, yet the force on the base is the same; the side walls carry the difference. .. GENERATED FROM PYTHON SOURCE LINES 35-42 .. code-block:: Python rho, depth, base = 998.0, 0.5, 0.01 volumes = {"narrow neck": 0.002, "straight": 0.005, "flared": 0.010} base_force = hydrostatic_pressure(rho, depth) * base for name, V in volumes.items(): print(f"{name:>11}: water weighs {rho * G * V:5.1f} N, force on base {base_force:.1f} N") .. rst-class:: sphx-glr-script-out .. code-block:: none narrow neck: water weighs 19.6 N, force on base 48.9 N straight: water weighs 48.9 N, force on base 48.9 N flared: water weighs 97.9 N, force on base 48.9 N .. GENERATED FROM PYTHON SOURCE LINES 43-49 A dam face ---------- Water 30 m deep stands against a vertical dam 1 m wide. The pressure grows linearly with depth, so the thrust is that at mid-depth times the area and acts two thirds of the way down. A 30 m column is about 3 atmospheres. .. GENERATED FROM PYTHON SOURCE LINES 49-66 .. code-block:: Python H, width = 30.0, 1.0 F = hydrostatic_force_plane(rho, H / 2, H * width) y_p = center_of_pressure_depth(H / 2, H * width, width * H**3 / 12) print(f"thrust {F / 1e6:.2f} MN per metre, acting {y_p:.1f} m below the surface") p_base = hydrostatic_pressure(rho, H) print(f"pressure at the base {p_base / 1e3:.0f} kPa = {pressure_head(p_base, 13546.0):.2f} m of mercury") y = np.linspace(0, H, 50) fig, ax = plt.subplots(figsize=(5, 4)) ax.fill_betweenx(y, 0, hydrostatic_pressure(rho, y) / 1e3, alpha=0.4) ax.axhline(y_p, color="k", ls="--", label=f"centre of pressure, {y_p:.0f} m") ax.invert_yaxis() ax.set(xlabel="pressure [kPa]", ylabel="depth [m]", title="Pressure on a dam face") ax.legend() fig.tight_layout() .. image-sg:: /api/gallery/fluid_engineering/hydrostatics/images/sphx_glr_plot_02_stevin_hydrostatic_paradox_001.png :alt: Pressure on a dam face :srcset: /api/gallery/fluid_engineering/hydrostatics/images/sphx_glr_plot_02_stevin_hydrostatic_paradox_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none thrust 4.40 MN per metre, acting 20.0 m below the surface pressure at the base 294 kPa = 2.21 m of mercury .. GENERATED FROM PYTHON SOURCE LINES 67-69 Stevin's result: the thrust on the vertical face is half the force the same area would carry lying flat at the full depth. .. GENERATED FROM PYTHON SOURCE LINES 69-75 .. code-block:: Python assert np.isclose(F, 0.5 * hydrostatic_pressure(rho, H) * H * width) assert np.isclose(y_p, 2 * H / 3) assert np.isclose(base_force, rho * G * depth * base) plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.030 seconds) .. _sphx_glr_download_api_gallery_fluid_engineering_hydrostatics_plot_02_stevin_hydrostatic_paradox.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/fluid_engineering/hydrostatics/plot_02_stevin_hydrostatic_paradox.ipynb :alt: Launch JupyterLite :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_02_stevin_hydrostatic_paradox.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_02_stevin_hydrostatic_paradox.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_02_stevin_hydrostatic_paradox.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_