Exerciseschevron_rightChapter 1chevron_right1.2
fitness_center

Exercise 1.2

Mud Weight Window

Level 1
Chapter 1: Python Setup for Petroleum Engineering
descriptionProblem

A drilling engineer must keep the mud weight inside a safe operating window. Heavy enough to prevent a kick, light enough not to fracture the formation.

At 8,000 ft TVD the formation pressure is 3,500 psi and the fracture pressure is 5,200 psi. Hydrostatic pressure obeys

P=0.052×MW×TVDP = 0.052 \times MW \times TVD

with MWMW in ppg, TVDTVD in ft, and PP in psi.

Compute three values:

  1. mw_min: the minimum mud weight (ppg) that balances the formation pressure.
  2. mw_max: the maximum mud weight (ppg) before fracturing.
  3. mw_schedule: a list of five evenly spaced mud weights from mw_min

to mw_max inclusive of both endpoints.

> Think about it: why do drillers aim for a mud weight slightly above > the minimum rather than exactly at it? What changes the static hydrostatic > pressure once the mud is actually circulating?

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.

tvd_ft = 8000
p_formation = 3500
p_fracture = 5200

mw_min = p_formation / (0.052 * tvd_ft)
mw_max = p_fracture  / (0.052 * tvd_ft)

step = (mw_max - mw_min) / 4
mw_schedule = [mw_min + i * step for i in range(5)]

print(f"Window: {mw_min:.2f} – {mw_max:.2f} ppg")
for mw in mw_schedule:
    print(f"  MW={mw:.2f} → P={0.052 * mw * tvd_ft:.0f} psi")

lockCopying code is a Full Access feature.