Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Multiwell Pressure–Depth Regression in Maple

This repository presents a Maple-based statistical workflow for modelling pressure–depth relationships across six wells and estimating pressure gradients within reservoir intervals. It demonstrates model formulation, ordinary and weighted least-squares regression, residual diagnostics, reservoir-effect testing, and multiwell comparison.

Project status: The individual-well analyses and combined candidate Models A–E have been implemented. Final model comparison and manuscript reporting are being refined.

Skills demonstrated

  • Statistical modelling and scientific programming in Maple.
  • Construction and interpretation of indicator and interaction terms.
  • Ordinary least squares, weighted least squares, and variance modelling.
  • Regression diagnostics and evidence-based model selection.
  • Analytical derivation of reservoir-specific pressure gradients.
  • Organisation and documentation of a traceable, version-controlled multiwell workflow.

Project motivation

Pressure generally changes with depth, but the relationship may vary between wells and between reservoir and non-reservoir intervals. A single untested linear equation can conceal these differences and may also produce unreliable uncertainty estimates when the residual variance is not constant.

This project therefore develops and diagnoses a pressure–depth model for each well before comparing the wells in a combined framework. The fitted pressure gradient is subsequently used as an input to a fluid-flow formulation.

Objectives

  • Quantify the pressure–depth relationship for each well.
  • Test whether reservoir intervals have a different pressure level or gradient.
  • Diagnose nonlinearity, non-normal residuals, and non-constant residual variance.
  • Use weighted least squares where ordinary least squares is inadequate.
  • Derive pressure-gradient expressions from the selected regression models.
  • Compare shared and well-specific pressure–depth behaviour across all six wells.

Data structure

Each well contains observations of:

  • depth, expressed as true vertical depth subsea (TVDSS);
  • pressure;
  • fluid or interval classification; and
  • reservoir membership.

The number and depth distribution of observations differ between wells. Reservoir membership is represented by an indicator:

$$ r_j = \begin{cases} 1, & \text{reservoir interval},\\ 0, & \text{otherwise}. \end{cases} $$

Depth is centred separately within each well:

$$ x_j = d_j - d_{\mathrm{ref}}, \qquad d_{\mathrm{ref}} = \frac{1}{n}\sum_{j=1}^{n} d_j. $$

Here, $n$ is the number of depth observations in the well. Centering makes the intercept interpretable as the estimated pressure near the mean observed depth rather than at the physically irrelevant value of zero depth.

Per-well model

The main candidate model is

$$ P_j = a_0 + b_Dx_j + b_Rr_j + b_{DR}(x_jr_j) + \varepsilon_j, $$

where:

  • $P_j$ is the observed pressure;
  • $a_0$ is the reference pressure for a non-reservoir observation at the centred depth;
  • $b_D$ is the non-reservoir pressure gradient;
  • $b_R$ represents a reservoir-associated pressure offset;
  • $b_{DR}$ represents the change in gradient associated with a reservoir interval; and
  • $\varepsilon_j$ is the unexplained residual error.

The resulting pressure-gradient equations are

$$ \frac{\partial P}{\partial d} = b_D \quad \text{for } r=0, $$

and

$$ \frac{\partial P}{\partial d} = b_D+b_{DR} \quad \text{for } r=1. $$

The interaction term is interpreted and retained only when it is supported by the data and the model diagnostics.

Model-development workflow

  1. Import and verify the pressure, depth, and reservoir variables.
  2. Centre depth using the mean depth of the relevant well.
  3. Fit the initial ordinary least-squares model.
  4. Inspect residuals against fitted values, centred depth, and reservoir class.
  5. Examine the residual Q–Q plot and Shapiro–Wilk result as supporting diagnostics.
  6. Compare reasonable alternatives, including log-pressure, quadratic-depth, and weighted least-squares models.
  7. Select the simplest scientifically meaningful model that adequately addresses the observed residual pattern.
  8. Derive the pressure gradient from the full-precision fitted coefficients.

Current findings

  • Separate regression workflows have been completed for all six wells.
  • Ordinary least-squares diagnostics revealed non-constant residual spread in several of the individual-well models.
  • Weighted least squares produced a more uniform residual pattern where heteroscedasticity was present and was therefore selected for those wells.
  • Reservoir–depth interactions were evaluated rather than assumed automatically; unsupported terms were not interpreted as established physical effects.
  • Final pressure-gradient expressions are derived from the selected models using the full-precision Maple estimates, rather than coefficients rounded for presentation.
  • The combined analysis is evaluating whether a common multiwell trend is adequate or whether well-specific slopes and curvature are required.

These findings are methodological summaries. Numerical coefficients and inferential results are retained in the working Maple outputs and will be summarised in the public-facing documentation after publication.

Combined multiwell analysis

The combined stage focuses on reservoir observations. Let $d$ denote centred depth and let $w_2,\ldots,w_6$ be indicator variables for Wells 2–6, with Well 1 serving as the reference well. Five candidate models are compared:

Model Maple basis terms Interpretation
A $1,d,w_2,\ldots,w_6$ Each well has its own reference pressure, while all wells share one linear pressure–depth gradient.
B Model A $+\ d^2$ Each well has its own reference pressure, while all wells share one linear gradient and one quadratic curvature.
C Model B $+\ d^2w_2,\ldots,d^2w_6$ Each well has its own reference pressure and quadratic curvature, while the linear gradient remains common.
D Model B $+\ dw_2,\ldots,dw_6$ Each well has its own reference pressure and linear gradient, while the quadratic curvature remains common.
E Model D $+\ d^2w_2,\ldots,d^2w_6$ Each well has its own reference pressure, linear gradient, and quadratic curvature.

Models D and E therefore distinguish two scientifically different possibilities. Model D permits well-specific pressure gradients but constrains the wells to share a common curve. Model E relaxes that final constraint and permits each well to have its own curve.

The models do not form a single unbranched sequence. Model A is nested within Model B; Model B is nested within both Models C and D; and Models C and D are each nested within Model E. Nested-model and partial $F$ tests are used where appropriate to assess whether the added terms improve the fit sufficiently to justify their complexity. Residual diagnostics remain part of the final selection rather than relying on statistical significance alone.

Repository structure

multiwell-pressure-depth-regression/
├── README.md
├── maple-code/
│   ├── 01_individual_well_models.mpl
│   └── 02_combined_well_model.mpl
└── worksheets/
    ├── 01_individual_well_models.mw
    └── 02_combined_well_model.mw
  • .mw files retain the complete Maple worksheets, including formatted mathematics, outputs, and plots.
  • .mpl files provide text-based Maple source code that can be reviewed and compared directly on GitHub.
  • 01_individual_well_models contains the separate modelling and diagnostic workflow for the six wells.
  • 02_combined_well_model contains the combined Models A–E and their comparison.

Software

  • Maple for data handling, regression, diagnostics, symbolic expressions, and visualisation.
  • Git and GitHub for version control, documentation, and transparent research development.

Using the repository

  1. Download or clone the repository.
  2. Open worksheets/01_individual_well_models.mw in Maple to view the six individual-well analyses.
  3. Open worksheets/02_combined_well_model.mw to view the combined Models A–E and their comparison.
  4. Review the corresponding files in maple-code/ to inspect the analysis commands as plain text.
  5. Where an authorised dataset is required, configure the data path locally before executing the analysis.

An .mpl script can be read from an active Maple session after the correct working directory and data paths have been configured:

read "maple-code/01_individual_well_models.mpl";
read "maple-code/02_combined_well_model.mpl";

Publication status

This analysis is being prepared for academic publication. Publication figures, final comparison tables, and final numerical results are intentionally excluded from the public-facing documentation at this stage. They will be added after publication, together with the article citation and the persistent identifier for the archived code release.

The exact Maple version and final execution requirements will also be recorded with the publication release.

Data availability and confidentiality

The original well data are not distributed with this repository because their use may be governed by data-owner or licensing restrictions. Public files should use anonymised well labels and must not contain restricted coordinates, identifiers, raw measurements, or other proprietary information.

The repository is intended to demonstrate the modelling workflow. Any example data added later should be synthetic, anonymised, or explicitly authorised for redistribution.

Before any pre-publication public release, the .mw and .mpl files must be checked for embedded data, numerical outputs, and other unpublished or restricted information. The working repository should remain private unless a sanitised release has been approved under the relevant journal and data-owner requirements.

Citation

The full article citation, software citation, and repository DOI will be added after publication.

Maintainer

Dr Iwa Abiola Akanni
Physicist and researcher working in geophysics, fluid flow in porous media, and applied statistical modelling.
GitHub: REBELABS

About

Maple-based statistical modelling of pressure–depth relationships across six wells, including OLS/WLS regression, reservoir effects, model diagnostics, and pressure-gradient estimation.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors