fitness_center
Exercise 4.6
Cumulative Production & EUR
Level 2
Chapter 4: NumPy & PandasdescriptionProblem
Given a daily oil rate sampled monthly over 12 months:
t_days = [0, 30, 60, 90, 120, 150, 180, 210, 240, 270, 300, 330, 360]
q_bopd = [1000, 860, 740, 640, 560, 490, 430, 380, 335, 295, 260, 230, 200]Using NumPy:
- Compute
cum_stb, cumulative production over 360 days using the
trapezoidal rule (np.trapz).
- Fit an exponential decline
by linear regression on vs . Store the decline constant in Di_per_day (units: 1/day).
- Use that fit + an economic limit of 30 bopd to compute EUR
in stock-tank barrels:
Store the answer in eur_stb.
lightbulbHints (0/3)
Stuck? Reveal hints one at a time — they progress from nudge to near-solution.
codeYour solution
main.py
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
t_days = np.array([0, 30, 60, 90, 120, 150, 180, 210, 240, 270, 300, 330, 360])
q_bopd = np.array([1000, 860, 740, 640, 560, 490, 430, 380, 335, 295, 260, 230, 200])
cum_stb = float(np.trapz(q_bopd, t_days))
slope, intercept = np.polyfit(t_days, np.log(q_bopd), 1)
Di_per_day = -float(slope)
qi = float(np.exp(intercept))
q_econ = 30
eur_stb = (qi - q_econ) / Di_per_day
print(f"Cumulative (360 d): {cum_stb:>10,.0f} STB")
print(f"Di: {Di_per_day:.5f} /day")
print(f"qi (fit): {qi:.1f} bopd")
print(f"EUR (q_econ=30): {eur_stb:>10,.0f} STB")
lockCopying code is a Full Access feature.