Decline curve analysis¶
Author: Olaf Yunus Laitinen Imanov (ORCID 0009-0006-5184-0810)
Affiliation: Department of Mathematics and Statistics, University of Helsinki
License: Mozilla Public License 2.0 (MPL-2.0), Copyright (c) 2026 Olaf Yunus Laitinen Imanov
Arps decline models, model selection with AIC, bootstrap uncertainty and EUR for a whole field.
# Install wellcast when it is not available yet (for example on Google Colab).
import importlib.util
from IPython import get_ipython
if importlib.util.find_spec("wellcast") is None:
get_ipython().run_line_magic(
"pip",
'install -q "wellcast[all]==0.1.0"',
)
The Arps models¶
For initial rate \(q_i\), nominal decline \(D_i\) and exponent \(b\) (Arps, 1945):
with the exponential (\(b = 0\), \(q = q_i e^{-D_i t}\)) and harmonic (\(b = 1\)) limits. Cumulative production follows in closed form, and the estimated ultimate recovery (EUR) is the cumulative at the time the rate reaches an economic limit.
import numpy as np
import pandas as pd
from wellcast.dca import DeclineModel, arps_cumulative, arps_rate, fit_many
t = np.arange(0.0, 3650.0, 30.0)
curves = pd.DataFrame(
{f"b = {b}": arps_rate(t, 1000.0, 0.8, b) for b in (0.0, 0.5, 1.0)}, index=t
)
curves.iloc[[0, 12, 24, 60, 120]].round(1)
| b = 0.0 | b = 0.5 | b = 1.0 | |
|---|---|---|---|
| 0.0 | 1000.0 | 1000.0 | 1000.0 |
| 360.0 | 454.5 | 514.4 | 559.1 |
| 720.0 | 206.6 | 312.6 | 388.0 |
| 1800.0 | 19.4 | 113.3 | 202.3 |
| 3600.0 | 0.4 | 40.9 | 112.5 |
# Cumulative after ten years for each exponent (bbl):
{b: round(float(arps_cumulative(3650.0, 1000.0, 0.8, b))) for b in (0.0, 0.5, 1.0)}
{0.0: 456408, 0.5: 730400, 1.0: 1002892}
Model selection on noisy data¶
Rates are fitted in log space (errors in rate data are multiplicative) with a robust loss, and the Akaike information criterion picks the model. Here the true exponent is 0.6.
rng = np.random.default_rng(1)
days = np.arange(0.0, 1500.0)
observed = arps_rate(days, 1200.0, 0.9, 0.6) * rng.lognormal(0.0, 0.05, days.size)
model = DeclineModel().fit(observed, time=days)
print(model)
pd.Series(model.aic_).sort_values().round(1)
DeclineModel(hyperbolic, qi=1191, di=0.894/yr, b=0.598)
hyperbolic -8951.3 harmonic -7774.8 exponential -7079.0 dtype: float64
Uncertainty¶
Resampling the fit residuals and refitting gives a distribution of parameters and EUR. Reserves convention: P90 is the low estimate (exceeded with 90 percent probability), P10 the high one.
model.bootstrap(300, seed=0)
model.eur_quantiles(econ_limit=10.0).round(0)
p90 1022647.0 p50 1033175.0 p10 1043421.0 Name: eur, dtype: float64
model.plot(pd.Series(observed, index=days), econ_limit=10.0)
A whole field¶
fit_many fits every well and reports wells that cannot be fitted (here the injector) instead of failing. Any row can be turned back into a model with DeclineModel.from_params.
import wellcast
production = wellcast.make_synthetic_field().production
table = fit_many(production, econ_limit=20.0)
table[["model", "qi", "di", "b", "eur", "remaining", "status"]]
| model | qi | di | b | eur | remaining | status | |
|---|---|---|---|---|---|---|---|
| well | |||||||
| I-01 | NaN | NaN | NaN | NaN | NaN | NaN | at least 4 positive rate observations are needed |
| P-01 | exponential | 2038.872112 | 0.679784 | 0.000000 | 1.084747e+06 | 27188.719547 | ok |
| P-02 | exponential | 2123.646306 | 0.757488 | 0.000000 | 1.014348e+06 | 21064.044080 | ok |
| P-03 | exponential | 1515.093888 | 0.425337 | 0.000000 | 1.283882e+06 | 146536.598897 | ok |
| P-04 | hyperbolic | 2146.758446 | 0.847909 | 0.096312 | 1.008349e+06 | 31076.740792 | ok |
| P-05 | hyperbolic | 2781.851540 | 1.329803 | 0.517290 | 1.436721e+06 | 287770.123257 | ok |
row = table.loc["P-03"]
rebuilt = DeclineModel.from_params(row["qi"], row["di"], row["b"], start=row["start"])
rebuilt.forecast(365 * 3, econ_limit=20.0).resample("YE")["rate"].mean().round(1)
date 2020-12-31 1264.1 2021-12-31 849.8 2022-12-31 555.5 2023-12-31 434.3 Freq: YE-DEC, Name: rate, dtype: float64
Caveats¶
Arps models assume boundary-dominated flow at constant operating conditions. Choke changes, workovers and water breakthrough break that assumption, which is why the fitted parameters of the synthetic wells differ from the true ones. Fit periods of stable operation, and check the residuals.