.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples_tutorials/example_time_dependent_debit.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_tutorials_example_time_dependent_debit.py: ================================================================================ Time dependent flowrate ================================================================================ Define a time dependant flowrate .. GENERATED FROM PYTHON SOURCE LINES 9-31 .. image-sg:: /auto_examples_tutorials/images/sphx_glr_example_time_dependent_debit_001.png :alt: example time dependent debit :srcset: /auto_examples_tutorials/images/sphx_glr_example_time_dependent_debit_001.png :class: sphx-glr-single-img .. code-block:: default import matplotlib.pyplot as plt import numpy as np import freshkiss3d as fk times = [5., 11., 14., 17.] flowrates = [0., 20., 20., 10.] tdd = fk.TimeDependentFlowRate(times, flowrates) simu_times = np.linspace(0, 20, 41) simu_flowrates = [tdd.interpolate(t) for t in simu_times] plt.plot(times, flowrates, 'ro') plt.plot(simu_times, simu_flowrates, 'bx') plt.xlim(-5, 25) plt.ylim(-5, 25) plt.xlabel('time') plt.ylabel('flowrate') plt.grid() plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 0.078 seconds) .. _sphx_glr_download_auto_examples_tutorials_example_time_dependent_debit.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: example_time_dependent_debit.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: example_time_dependent_debit.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_