.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples_gallery/plot_arps.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.py: ================== Plot an Arps curve ================== Shows how to plot curves. .. GENERATED FROM PYTHON SOURCE LINES 9-47 .. image-sg:: /examples_gallery/images/sphx_glr_plot_arps_001.png :alt: plot arps :srcset: /examples_gallery/images/sphx_glr_plot_arps_001.png :class: sphx-glr-single-img .. code-block:: Python import matplotlib.pyplot as plt import numpy as np from dca.datasets import load_monthly_sodir_production from dca.decline_curve_analysis import Arps # Load data to plot df = ( load_monthly_sodir_production() .loc[lambda df: df["prfInformationCarrier"] == "STATFJORD", :] .groupby("prfYear")["prfPrdOilNetMillSm3"] .sum() ) x = df.index - df.index.min() y = np.log(df.values) # Take log of production plt.plot(x, y, "-o", label="Data") # Plot a few log-curves x = np.linspace(0, 64) # Evaluation grid curve = Arps(7.3, 1.7, -1.9) plt.plot(x, curve.eval_log(x), label="Arps curve 1") curve = Arps(8.2, 1.2, -1.4) plt.plot(x, curve.eval_log(x), label="Arps curve 2") curve = Arps(7.1, 1.8, -2) plt.plot(x, curve.eval_log(x), label="Arps curve 3") plt.xlabel("Months since production start") plt.ylabel("log Production") plt.grid(True, ls="--", alpha=0.33) plt.legend() plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.503 seconds) .. _sphx_glr_download_examples_gallery_plot_arps.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.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_arps.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_arps.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_