Python Presets

Part 12, The Geomechanics Lab

Learning objectives

  • Run five of the book's models as complete Python programs on Ogbon-1's own numbers
  • See that every Ogbon-1 number and unit factor in a program is written in from the book's model as the page loads
  • Read what each program prints against the sections that print the same numbers
  • Change a program's inputs and read the model's answer for your what-if

Five Models You Can Run

The book's models are short arithmetic, and each of these presets is one of them written out as a complete Python program, numpy for the arithmetic and matplotlib for the figure, on Ogbon-1's own numbers. Every Ogbon-1 number and unit factor at the top of a program is written in from the book's model as the page loads, to enough decimals that the program prints what the sections print. So a preset is a checked base: run it as it stands and it gives the section's numbers; change an input and it gives the model's answer for your what-if.

Python PresetsInteractive figure, enable JavaScript to interact.

The Five Programs

  • The tensor, the principal stresses and the Mohr circle (Sections 1.1 to 1.3). It turns Ogbon-1's stress at the main sand's top into north, east and down, with a shear of 153 psi and a trace of 14286 psi; finds the principal stresses again from that tensor alone with numpy's eigh, 5657 psi vertical, 4469 psi at 40 degrees and 4159 psi at 130 degrees; and prints the effective circle, centre 2103 psi and radius 749 psi, 647 psi of pore pressure from slip.
  • The stress polygon and the friction the well mobilizes (Sections 5.2 and 5.3). At a friction of 0.6, q=3.12q = 3.12: Shmin's floor is 3720 psi and SHmax's ceiling 11702 psi, and at Ogbon-1's Shmin friction allows SHmax up to 7028 psi (Section 8.5). The stress ratio is 2.11 and the friction it mobilizes 0.381: inside the polygon, in normal faulting.
  • The wall and the mud-weight window (Sections 6.2, 6.4 and 7.2). At the book's mud the largest hoop stress, 3478 psi, is under the strength, 6519 psi: no breakouts. The window runs from the kick, 8.79 ppg, to the loss, 13.04 ppg; collapse is −0.24 ppg, the DITF line 16.31 ppg and breakdown 18.35 ppg, 5855 psi.
  • Normal pressure and Eaton's method (Sections 4.1 and 4.5). Fitted alone, the five water tests lie on 0.456 psi/ft through −3 psi, water of 1.051 g/cc. Eaton's law at the main sand's top returns the water line, 2793 psi, exactly at a ratio of 1, and 409 psi over it at 0.95.
  • The frame, the stress path and the compaction (Sections 2.2, 2.4, 10.1 and 10.3). The main sand's frame has a Poisson's ratio of 0.063, a Biot coefficient of 0.893 and a uniaxial modulus of 10.39 GPa, and a stress path of 0.833. The Reservoir book's stated depletion of 1651 psi lowers Shmin 1376 psi, to 2784 psi, still above the 2598 psi floor friction then allows; each bed shortens 0.098 %, the column of 386 ft by 4.53 in.

How the Page Runs Them

The page cannot run Python, so it runs each program's arithmetic through the kernel's own laws on the numbers the program carries and prints what the program prints, in Python's formats. The book's checks run the same arithmetic again by hand, from the numbers they read out of the program's own text, and hold every printed line to the page's and every number the sections print to the program's. The marked lines in (a) are the ones the page filled: nothing else in a program is Ogbon-1's.

Using Them

Copy a program, download it, or open it in the Python Playground under Tools and run it there. Change one input at a time and read the answer against the number the section prints: a stronger friction in the Mohr circle program, a heavier mud in the window, a larger drawdown in the depletion. The next section closes the loop: an advisor that reads your problem and points you to the model, the section and the preset to start from.

This page is prerendered for SEO and accessibility. The interactive widgets above hydrate on JavaScript load.