.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "api/gallery/hydrology/plot_06_manning_formula.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_hydrology_plot_06_manning_formula.py: Manning's formula (1889) ======================== Robert Manning compared the many empirical formulas proposed after Chézy with the gaugings of rivers and canals, and found that the Chézy coefficient grows roughly as the sixth root of the hydraulic radius for a given bed. The mean velocity then becomes ``R**(2/3) S**(1/2) / n``, with one roughness number per kind of channel. The example shows that Chézy's ``C`` is not a constant, and that Manning's formula is Chézy's with ``C = R**(1/6) / n``. .. GENERATED FROM PYTHON SOURCE LINES 12-33 .. image-sg:: /api/gallery/hydrology/images/sphx_glr_plot_06_manning_formula_001.png :alt: C = R^(1/6) / n, v = R^(2/3) S^(1/2) / n, S = 1e-3 :srcset: /api/gallery/hydrology/images/sphx_glr_plot_06_manning_formula_001.png :class: sphx-glr-single-img .. code-block:: Python import matplotlib.pyplot as plt import numpy as np from earthsciencekit.hydrology import chezy_from_manning, chezy_velocity, manning_velocity radius = np.logspace(-1, 1, 100) fig, (left, right) = plt.subplots(1, 2, figsize=(9, 4)) for roughness, bed in [(0.012, "concrete"), (0.03, "clean river"), (0.07, "weedy river")]: coefficient = chezy_from_manning(roughness, radius) velocity = manning_velocity(roughness, radius, 1e-3) assert np.allclose(velocity, chezy_velocity(coefficient, radius, 1e-3)) left.semilogx(radius, coefficient, label=f"{bed}, n = {roughness}") right.loglog(radius, velocity, label=bed) assert np.isclose(manning_velocity(0.03, 8.0, 1e-3) / manning_velocity(0.03, 1.0, 1e-3), 4) left.set(xlabel="hydraulic radius [m]", ylabel="Chézy C [m^0.5/s]", title="C = R^(1/6) / n") right.set(xlabel="hydraulic radius [m]", ylabel="velocity [m/s]", title="v = R^(2/3) S^(1/2) / n, S = 1e-3") left.legend(fontsize="small") fig.tight_layout() plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.318 seconds) .. _sphx_glr_download_api_gallery_hydrology_plot_06_manning_formula.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/hydrology/plot_06_manning_formula.ipynb :alt: Launch JupyterLite :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_06_manning_formula.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_06_manning_formula.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_06_manning_formula.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_