.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples_gallery/plot_arps_methods.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_examples_gallery_plot_arps_methods.py: ============= Curve methods ============= Plot an Arps curve, its integral and shifted/scaled curves. .. GENERATED FROM PYTHON SOURCE LINES 9-47 .. image-sg:: /examples_gallery/images/sphx_glr_plot_arps_methods_001.png :alt: Arps curve, Integral of curve, Shifted along x-axis, Scaled along x-axis :srcset: /examples_gallery/images/sphx_glr_plot_arps_methods_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none Integral from 0 to infty: 148.41 q_1=12.182 h=0.119 D=0.093 | .. code-block:: Python import matplotlib.pyplot as plt import numpy as np from dca.decline_curve_analysis import Arps fig, axes = plt.subplots(2, 2, sharex=True, sharey=False) ax1, ax2, ax3, ax4 = axes.ravel() # Create evaluation grid and model t = np.linspace(0, 40, num=2**8) curve = Arps(5, 2.5, -2) ax1.set_title("Arps curve") ax1.plot(t, curve.eval(t)) ax2.set_title("Integral of curve") ax2.plot(t, curve.eval_integral_from_0_to_T(t)) ax3.set_title("Shifted along x-axis") ax3.plot(t, curve.eval(t)) ax3.plot(t, curve.shift_and_scale(shift=-5).eval(t)) ax4.set_title("Scaled along x-axis") ax4.plot(t, curve.eval(t)) ax4.plot(t, curve.shift_and_scale(scale=2).eval(t)) # Print some information integral = curve.eval_integral_from_0_to_inf() print(f"Integral from 0 to infty: {integral:.2f}") q_1, h, D = curve.original_parametrization() print(f"{q_1=:.3f} {h=:.3f} {D=:.3f}") for ax in [ax1, ax2, ax3, ax4]: ax.grid(True, ls="--", alpha=0.33) plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.160 seconds) .. _sphx_glr_download_examples_gallery_plot_arps_methods.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_arps_methods.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_arps_methods.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_arps_methods.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_