.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/Analytic_Solutions_Front/plot_as_frt_time.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. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_Analytic_Solutions_Front_plot_as_frt_time.py: Plot front position over time. =========================== This section shows how to use *show_fronts_over_time* function to plot front position depending on time. For each case, we will use an initial water depth :math:`h_0 = 20m`. For Mangeney's method, we use a slope of :math:`\theta = 30°` and a friction angle of :math:`\delta = 25°`. For Stoker's method, we use a domain depth of :math:`h_r = 1m`: Implementation ----------------- .. GENERATED FROM PYTHON SOURCE LINES 12-19 .. code-block:: Python from tilupy.analytic_sol import Front_result import numpy as np A = Front_result(h0=20) .. GENERATED FROM PYTHON SOURCE LINES 20-21 --------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 24-25 **Case 1**: computing only for :math:`t = 5s`. .. GENERATED FROM PYTHON SOURCE LINES 25-35 .. code-block:: Python t = 5 A.xf_mangeney(t, delta=25, theta=30) A.xf_dressler(t) A.xf_ritter(t) A.xf_stoker(t, hr=1) A.xf_chanson(t, f=0.05) A.show_fronts_over_time() .. image-sg:: /auto_examples/Analytic_Solutions_Front/images/sphx_glr_plot_as_frt_time_001.png :alt: plot as frt time :srcset: /auto_examples/Analytic_Solutions_Front/images/sphx_glr_plot_as_frt_time_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 36-37 --------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 40-41 **Case 2**: computing for :math:`t = {1, 5, 10, 15, 20}s`. .. GENERATED FROM PYTHON SOURCE LINES 41-52 .. code-block:: Python T = [1, 10, 15, 20] # t = 5 already compute for t in T: A.xf_mangeney(t, delta=25, theta=30) A.xf_dressler(t) A.xf_ritter(t) A.xf_stoker(t, hr=1) A.xf_chanson(t, f=0.05) A.show_fronts_over_time() .. image-sg:: /auto_examples/Analytic_Solutions_Front/images/sphx_glr_plot_as_frt_time_002.png :alt: plot as frt time :srcset: /auto_examples/Analytic_Solutions_Front/images/sphx_glr_plot_as_frt_time_002.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 53-54 Ritter and Dressler's solutions are the same. .. GENERATED FROM PYTHON SOURCE LINES 56-57 --------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 60-61 **Case 3**: computing for :math:`t \in [0, 20]`. .. GENERATED FROM PYTHON SOURCE LINES 61-74 .. code-block:: Python T = np.linspace(0, 20, 100) # t = 5 already compute A = Front_result(h0=20) # Reset values for t in T: A.xf_mangeney(t, delta=25, theta=30) A.xf_dressler(t) A.xf_ritter(t) A.xf_stoker(t, hr=1) A.xf_chanson(t, f=0.05) A.show_fronts_over_time() .. image-sg:: /auto_examples/Analytic_Solutions_Front/images/sphx_glr_plot_as_frt_time_003.png :alt: plot as frt time :srcset: /auto_examples/Analytic_Solutions_Front/images/sphx_glr_plot_as_frt_time_003.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 75-76 Ritter and Dressler's solutions are the same. .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.175 seconds) .. _sphx_glr_download_auto_examples_Analytic_Solutions_Front_plot_as_frt_time.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_as_frt_time.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_as_frt_time.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_as_frt_time.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_