.. 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_method.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_method.py: Plot front position for each method. =========================== This section shows how to use *show_fronts_over_methods* function to plot front position for each methods. 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-17 .. code-block:: Python from tilupy.analytic_sol import Front_result A = Front_result(h0=20) .. GENERATED FROM PYTHON SOURCE LINES 18-19 --------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 22-23 **Case 1**: computing only for :math:`t = 5s`. .. GENERATED FROM PYTHON SOURCE LINES 23-33 .. 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_methods() .. image-sg:: /auto_examples/Analytic_Solutions_Front/images/sphx_glr_plot_as_frt_method_001.png :alt: Flow front positions over time :srcset: /auto_examples/Analytic_Solutions_Front/images/sphx_glr_plot_as_frt_method_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 34-35 --------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 38-39 **Case 2**: computing for :math:`t = {1, 5, 10, 15, 20}s`. .. GENERATED FROM PYTHON SOURCE LINES 39-49 .. 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_methods() .. image-sg:: /auto_examples/Analytic_Solutions_Front/images/sphx_glr_plot_as_frt_method_002.png :alt: Flow front positions over time :srcset: /auto_examples/Analytic_Solutions_Front/images/sphx_glr_plot_as_frt_method_002.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.190 seconds) .. _sphx_glr_download_auto_examples_Analytic_Solutions_Front_plot_as_frt_method.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_method.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_as_frt_method.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_as_frt_method.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_