Exercise 5.1
Decline Rate Comparison
Generate exponential-decline production for three wells with the same initial rate and different decline rates:
- Gentle:
- Moderate:
- Aggressive:
All start at bbl/day. Compute monthly rates over 36 months using .
Build:
t: NumPy array0, 1, ..., 36.q_gentle,q_moderate,q_aggressive: three NumPy arrays of rates.- A figure with two side-by-side subplots built via
fig, axes = plt.subplots(1, 2, figsize=(14, 5)). The left axis axes[0] plots all three wells on a linear y-scale. The right axis axes[1] plots the same three wells on a semi-log y-scale (axes[1].set_yscale("log")).
- Both panels need axis labels, a title, and a legend.
> Think about it: why does the petroleum industry prefer the > semi-log view for decline analysis? What information becomes visible > on the log scale that the linear scale hides?
Stuck? Reveal hints one at a time — they progress from nudge to near-solution.
visibilityReveal reference solutionexpand_more
Try solving it yourself first — the hints walk you through it. The solution below is one valid approach; yours may differ and still be correct.
import numpy as np
import matplotlib.pyplot as plt
qi = 1000
t = np.arange(0, 37)
q_gentle = qi * np.exp(-0.02 * t)
q_moderate = qi * np.exp(-0.05 * t)
q_aggressive = qi * np.exp(-0.10 * t)
fig, axes = plt.subplots(1, 2, figsize=(14, 5))
for ax in axes:
ax.plot(t, q_gentle, label="Gentle (Di=0.02/mo)")
ax.plot(t, q_moderate, label="Moderate (Di=0.05/mo)")
ax.plot(t, q_aggressive, label="Aggressive (Di=0.10/mo)")
ax.set_xlabel("Month")
ax.set_ylabel("Oil rate (bbl/day)")
ax.legend()
ax.grid(True, alpha=0.3)
axes[0].set_title("Linear scale")
axes[1].set_yscale("log")
axes[1].set_title("Semi-log scale")
fig.suptitle("Decline-rate comparison - linear vs semi-log", fontweight="bold")
plt.tight_layout()
plt.show()
lockCopying code is a Full Access feature.