Skip to main content
Log in

Physiological insights into electrodiffusive maintenance of gastric mucus through sensitivity analysis and simulations

  • Published:
Journal of Mathematical Biology Aims and scope Submit manuscript

Abstract

It is generally accepted that the gastric mucosa and adjacent mucus layer are critical in the maintenance of a pH gradient from stomach lumen to stomach wall, protecting the mucosa from the acidic environment of the lumen and preventing auto-digestion of the epithelial layer. No conclusive study has shown precisely which physical, chemical, and regulatory mechanisms are responsible for maintaining this gradient. However, experimental work and modeling efforts have suggested that concentration dependent ion-exchange at the epithelial wall, together with hydrogen ion/mucus network binding, may produce the enormous pH gradients seen in vivo. As of yet, there has been no exhaustive study of how sensitive these modeling results are with respect to variation in model parameters, nor how sensitive such a regulatory mechanism may be to variation in physical/biological parameters. In this work, we perform sensitivity analysis (using Sobol’ Indices) on a previously reported model of gastric pH gradient maintenance. We quantify the sensitivity of mucosal wall pH (as a proxy for epithelial health) to variations in biologically relevant parameters and illustrate how variations in these parameters affects the distribution of the measured pH values. In all parameter regimes, we see that the rate of cation/hydrogen exchange at the epithelial wall is the dominant parameter/effect with regards to variation in mucosal pH. By careful sensitivity analysis, we also investigate two different regimes representing high and low hydrogen secretion with different physiological interpretations. By complementing mechanistic modeling and biological hypotheses testing with parametric sensitivity analysis we are able to conclude which biological processes must be tightly regulated in order to robustly maintain the pH values necessary for healthy function of the stomach.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9

Similar content being viewed by others

References

  • Allen A, Flemström G (2005) Gastroduodenal mucus bicarbonate barrier: protection against acid and pepsin. Am J Phys Cell Physiol 288(1):C1

    Article  Google Scholar 

  • Allen A, Garner A (1980) Mucus and bicarbonate secretion in the stomach and their possible role in mucosal protection. Gut 21(3):249

    Article  Google Scholar 

  • Allen A, Flemström G, Garner A, Kivilaakso E (1993) Gastroduodenal mucosal protection. Physiol Rev 73(4):823

    Article  Google Scholar 

  • Bahari HM, Ross IN, Turnberg LA (1982) Demonstration of a pH gradient across the mucus layer on the surface of human gastric mucosa in vitro. Gut 23(6):513

    Article  Google Scholar 

  • Berne RM, Levy MN (1993) Physiology, 3rd edn. Mosby

  • Borgonovo E, Plischke E (2016) Sensitivity analysis: a review of recent advances. Eur J Oper Res 248(3):869

  • Chu S, Tanaka S, Kaunitz JD, Montrose MH (1999) Dynamic regulation of gastric surface pH by luminal pH. J Clin Investig 103(5):605

    Article  Google Scholar 

  • Cone RA (2009) Barrier properties of mucus. Adv Drug Deliv Rev 61(2):75

    Article  Google Scholar 

  • Doi M, See H (1996) Introduction to polymer physics. Oxford Clarendon Press, New York

    Google Scholar 

  • Engel E, Peskoff A, Kauffman GL, Grossman MI (1984) Analysis of hydrogen ion concentration in the gastric gel mucus layer. Am J Physiol 247(4 Pt 1):G321

    Google Scholar 

  • Fordtran JS, Locklear TW (1966) Ionic constituents and osmolality of gastric and small-intestinal fluids after eating. Am J Dig Dis 11(7):503

    Article  Google Scholar 

  • Glasserman P (2013) Monte Carlo methods in financial engineering, vol 53. Springer Science & Business Media, Berlin

    MATH  Google Scholar 

  • Hamby D (1994) A review of techniques for parameter sensitivity analysis of environmental models. Environ Monit Assess 32(2):135

    Article  Google Scholar 

  • Harenberg D, Marelli S, Sudret B, Winschel V (2017) Uncertainty quantification and global sensitivity analysis for economic models. Quant Econ 10(1):1

    Article  MathSciNet  Google Scholar 

  • Holm L, Flemström G (1990) Microscopy of acid transport at the gastric surface in vivo. J Intern Med Suppl 732:91

    Article  Google Scholar 

  • Jansen MJ (1999) Analysis of variance designs for model output. Comput Phys Commun 117(1–2):35

    Article  Google Scholar 

  • Johansson M, Synnerstad I, Holm L (2000) Acid transport through channels in the mucous layer of rat stomach. Gastroenterology 119(5):1297

    Article  Google Scholar 

  • Joseph IMP, Zavros Y, Merchant JL, Kirschner D (2003) A model for integrative study of human gastric acid secretion. J Appl Physiol 94(4):1602

    Article  Google Scholar 

  • Kaunitz JD (1999) Barrier function of gastric mucus. Keio J Med 48(2):63

    Article  Google Scholar 

  • Keener J, Sneyd J (2009) Mathematical physiology, vol I: cellular physiology, interdisciplinary applied mathematics, vol 8, 2nd edn. Springer, New York

  • Kucherenko S, Song S (2017) Different numerical estimators for main effect global sensitivity indices. Reliab Eng Syst Saf 165:222

    Article  Google Scholar 

  • Leveque RJ (2007) Finite difference methods for ordinary and partial differential equations. Steady-state and time-dependent problems (Society for Industrial and Applied Mathematics)

  • Lewis OL, Keener JP, Fogelson AL (2017) A physics-based model for maintenance of the pH gradient in the gastric mucus layer. Am J Physiol Gastrointest Liver Physiol 313(6):G599

    Article  Google Scholar 

  • Lewis O, Keener J, Fogelson A (2018) Electrodiffusion-mediated swelling of a two-phase gel model of gastric mucus. Gels 4(3):76

    Article  Google Scholar 

  • Li L, Lieleg O, Jang S, Ribbeck K, Han J (2012) A microfluidic in vitro system for the quantitative study of the stomach mucus barrier function. Lab Chip 12(20):4071

    Article  Google Scholar 

  • Marino S, Hogue IB, Ray CJ, Kirschner DE (2008) A methodology for performing global uncertainty and sensitivity analysis in systems biology. J Theor Biol 254(1):178

    Article  MathSciNet  Google Scholar 

  • Marshall B (2002) Helicobacter pioneers: firsthand accounts from the scientists who discovered helicobacters 1892–1982. Wiley-Blackwell, Hoboken

    Google Scholar 

  • Mathelin L, Hussaini MY, Zang TA, Bataille F (2004) Uncertainty propagation for a turbulent, compressible nozzle flow using stochastic methods. AIAA J 42(8):1669

    Article  Google Scholar 

  • Mathelin L, Hussaini MY, Zang TA (2005) Stochastic approaches to uncertainty quantification in CFD simulations. Numer Algorithms 38(1–3):209

    Article  MathSciNet  Google Scholar 

  • Owen AB (2013) Better estimation of small Sobol sensitivity indices. ACM Trans Model Comput Simul TOMACS 23(2):11

    MathSciNet  MATH  Google Scholar 

  • Riddell MJ, Strong JA, Cameron D (1960) The electrolyte concentration of human gastric secretion. Q J Exp Physiol Cogn Med Sci 45(1):1

    Google Scholar 

  • Saltelli A, Annoni P (2010) How to avoid a perfunctory sensitivity analysis. Environ Model Softw 25(12):1508

    Article  Google Scholar 

  • Saltelli A, Annoni P, Azzini I, Campolongo F, Ratto M, Tarantola S (2010) Variance based sensitivity analysis of model output. Design and estimator for the total sensitivity index. Comput Phys Commun 181(2):259

    Article  MathSciNet  Google Scholar 

  • Schreiber SS, Scheid PP (1997) Gastric mucus of the guinea pig: proton carrier and diffusion barrier. Am J Physiol 272(1 Pt 1):G63

    Google Scholar 

  • Schubert ML (2004) Gastric secretion. Curr Opin Gastroenterol 20(6):519

    Article  Google Scholar 

  • Sircar S, Keener JP, Fogelson AL (2013) The effect of divalent vs. monovalent ions on the swelling of Mucin-like polyelectrolyte gels: governing equations and equilibrium analysis. J Chem Phys 138(1):014901

    Article  Google Scholar 

  • Sobol IM (1993) Sensitivity analysis for non-linear mathematical models. Math Model Comput Exp 1(4):407

    MATH  Google Scholar 

  • Sobol IM, Asotsky D, Kreinin A, Kucherenko S (2011) Construction and comparison of high-dimensional Sobol generators. Wilmott 56:64

    Article  Google Scholar 

  • Tam PY, Verdugo P (1981) Control of mucus hydration as a Donnan equilibrium process. Nature 292(5821):340

    Article  Google Scholar 

  • Tanaka T, Fillmore DJ (1979) Kinetics of swelling of gels. J Chem Phys 70(3):1214

    Article  Google Scholar 

  • Thjodleifsson B, Wormsley KG (1977) Back-diffusion–fact or fiction? Digestion 15(1):53

    Article  Google Scholar 

  • Van Griensven A, Meixner T, Grunwald S, Bishop T, Diluzio M, Srinivasan R (2006) A global sensitivity analysis tool for the parameters of multi-variable catchment models. J Hydrol 324(1–4):10

    Article  Google Scholar 

  • Verdugo P, Deyrup-Olsen I, Martin AW, Luchtel DL (1992) Mechanics of swelling: from clays to living cells and tissues. Springer-Verlag, Berlin, Heidelberg, pp 671–681

    Book  Google Scholar 

  • Williams SE, Turnberg LA (1981) Demonstration of a pH gradient across mucus adherent to rabbit gastric mucosa: evidence for a mucus-bicarbonate barrier. Gut 22(2):94

    Article  Google Scholar 

Download references

Funding

Funding was provided by Foundation for the National Institutes of Health (Grant No. 1R01GM131408).

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Owen L. Lewis.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Appendices

Appendices

1.1 A Extra figures

Here we present the remaining violin plots from the SI calculations in Sects. 4.1 and 4.2. These parameters all exhibit small SI, and were therefore deemed “unimportant” for discussion. We include these figures for completeness (Figs. 10, 11, and 12).

Fig. 10
figure 10

Violin and box plots for \(-\log _{10}\big (H_0\big )\) as a function of a bicarbonate offset parameter \(\delta _\text {AB}\), and b hydrogen offset parameter \(\delta _\text {HI}\) during Sobol’ analysis of all 7 parameters

Fig. 11
figure 11

Violin and box plots for \(-\log _{10}\big (H_0\big )\) as a function of a bicarbonate offset parameter (\(\delta _\text {AB}\)), b hydrogen offset parameter (\(\delta _\text {HI}\)), c lumenal hydrogen concentration \(H_L\), and (d) lumenal cation concentration \(I_L\) when hydrogen source is large (\(S_0 = 10\))

Fig. 12
figure 12

Violin and box plots for \(-\log _{10}\big (H_0\big )\) as a function of a bicarbonate offset parameter (\(\delta _\text {AB}\)), and b hydrogen offset parameter \(\delta _\text {HI}\), when hydrogen source is small (\(S_0 = 0.1\))

B Iterative solution scheme

To determine the steady state ion concentrations (and then evaluate the QoI), we must solve the following system of five equations

$$\begin{aligned} \frac{\partial }{\partial x}\Big (u(x)C_\text {H} \Big )= & {} \frac{1}{\theta _s(x)} \frac{\partial }{\partial x}\left( \theta _s(x) \Bigg ( D_\text {H} \frac{\partial }{\partial x}C_\text {H} + z_\text {H}D_\text {H} C_\text {H} \frac{\partial }{\partial x}\Psi \Bigg ) \right) - \kappa C_\text {H}C_\text {B} + S(x), \qquad \end{aligned}$$
(B.1)
$$\begin{aligned} \frac{\partial }{\partial x}\Big (u(x)C_\text {B} \Big )= & {} \frac{1}{\theta _s(x)} \frac{\partial }{\partial x}\left( \theta _s(x) \Bigg ( D_\text {B} \frac{\partial }{\partial x}C_\text {B} + z_\text {B}D_\text {B} C_\text {B} \frac{\partial }{\partial x}\Psi \Bigg ) \right) - \kappa C_\text {H}C_\text {B}, \end{aligned}$$
(B.2)
$$\begin{aligned} \frac{\partial }{\partial x}\Big (u(x)C_\text {A} \Big )= & {} \frac{1}{\theta _s(x)} \frac{\partial }{\partial x}\left( \theta _s(x) \Bigg ( D_\text {A} \frac{\partial }{\partial x}C_\text {A} + z_\text {H}D_\text {A} C_\text {A} \frac{\partial }{\partial x}\Psi \Bigg ) \right) + S(x), \end{aligned}$$
(B.3)
$$\begin{aligned} \frac{\partial }{\partial x}\Big (u(x)C_\text {I} \Big )= & {} \frac{1}{\theta _s(x)} \frac{\partial }{\partial x}\left( \theta _s(x) \Bigg ( D_\text {I} \frac{\partial }{\partial x}C_\text {I} + z_\text {I}D_\text {I} C_\text {I} \frac{\partial }{\partial x}\Psi \Bigg ) \right) , \end{aligned}$$
(B.4)
$$\begin{aligned}&z_\text {H}C_\text {H} + z_\text {B}C_\text {B} + z_\text {A}C_\text {A} + z_\text {I}C_\text {I} = 0. \end{aligned}$$
(B.5)

Unfortunately, Eqs. (B.1) and (B.4) all contain a similar quadratic non-linearity in the electrodiffusive flux term (the product of concentration and electric potential gradient), while Eqs. (B.1) and (B.2) contain a second quadratic non-linearity in the hydrogen buffering term. For this reason, we solve the steady state equations using an iterative relaxation scheme. Given a guess for the solutions \(C^*_i\) (\(i = \text {H},\text {B},\text {A},\text {I}\)) and \(\Psi ^*\), we define the n-th iterates \(C^n_i\) (\(i = \text {H},\text {B},\text {A},\text {I}\)) and \(\Psi ^n\) via the linearized equations

$$\begin{aligned}&\frac{\partial }{\partial x}\Big (u(x)C^n_\text {H} \Big )= \frac{1}{\theta _s(x)} \frac{\partial }{\partial x}\left( \theta _s(x) \Bigg ( D_\text {H} \frac{\partial }{\partial x}C^n_\text {H} + z_\text {H}D_\text {H} C^*_\text {H} \frac{\partial }{\partial x}\Psi ^n \Bigg ) \right) - \kappa C^n_\text {H}C^*_\text {B} + S(x), \end{aligned}$$
(B.6)
$$\begin{aligned}&\frac{\partial }{\partial x}\Big (u(x)C^n_\text {B} \Big )= \frac{1}{\theta _s(x)} \frac{\partial }{\partial x}\left( \theta _s(x) \Bigg ( D_\text {B} \frac{\partial }{\partial x}C^n_\text {B} + z_\text {B}D_\text {B} C^*_\text {B} \frac{\partial }{\partial x}\Psi ^n \Bigg ) \right) - \kappa C^*_\text {H}C^n_\text {B}, \end{aligned}$$
(B.7)
$$\begin{aligned}&\frac{\partial }{\partial x}\Big (u(x)C^n_\text {A} \Big )= \frac{1}{\theta _s(x)} \frac{\partial }{\partial x}\left( \theta _s(x) \Bigg ( D_\text {A} \frac{\partial }{\partial x}C^n_\text {A} + z_\text {H}D_\text {A} C^*_\text {A} \frac{\partial }{\partial x}\Psi ^n \Bigg ) \right) + S(x), \end{aligned}$$
(B.8)
$$\begin{aligned}&\frac{\partial }{\partial x}\Big (u(x)C^n_\text {I} \Big )= \frac{1}{\theta _s(x)} \frac{\partial }{\partial x}\left( \theta _s(x) \Bigg ( D_\text {I} \frac{\partial }{\partial x}C^n_\text {I} + z_\text {I}D_\text {I} C^*_\text {I} \frac{\partial }{\partial x}\Psi ^n \Bigg ) \right) , \end{aligned}$$
(B.9)
$$\begin{aligned}&z_\text {H}C^n_\text {H} + z_\text {B}C^n_\text {B} + z_\text {A}C^n_\text {A} + z_\text {I}C^n_\text {I} = 0. \end{aligned}$$
(B.10)

Following the same line of thinking, the linearized boundary conditions for Eqs. (B.6) to (B.9) are given by

$$\begin{aligned}&\left. -D_\text {H} \frac{\partial }{\partial x}C^n_\text {H} - D_\text {H} z_\text {H} C^*_\text {H} \frac{\partial }{\partial x}\Psi ^n + C^n_\text {H}u \right| _{x = 0} = \left. k_\text {HI} \Big ( C^n_\text {I} - \delta _\text {HI} C^n_\text {H}\Big ) \right| _{x=0}, \end{aligned}$$
(B.11)
$$\begin{aligned}&\left. -D_\text {B} \frac{\partial }{\partial x}C^n_\text {B} - D_\text {B} z_\text {B} C^*_\text {B} \frac{\partial }{\partial x}\Psi ^n + C^n_\text {B}u \right| _{x = 0} = \left. k_\text {AB} \Big ( C_\text {A} - \delta _\text {AB} C_\text {B}\Big ) \right| _{x=0}, \end{aligned}$$
(B.12)
$$\begin{aligned}&\left. -D_\text {A} \frac{\partial }{\partial x}C^n_\text {A} - D_\text {A} z_\text {A} C^*_\text {A} \frac{\partial }{\partial x}\Psi ^n + C^n_\text {A}u \right| _{x = 0} = \left. -k_\text {AB} \Big ( C_\text {A} - \delta _\text {AB} C_\text {B}\Big ) \right| _{x=0}, \qquad \end{aligned}$$
(B.13)
$$\begin{aligned}&\left. -D_\text {I} \frac{\partial }{\partial x}C^n_\text {I} - D_\text {I} z_\text {I} C^*_\text {I} \frac{\partial }{\partial x}\Psi ^n + C^n_\text {I}u \right| _{x = 0} = \left. - k_\text {HI} \Big ( C^n_\text {I} - \delta _\text {HI} C^n_\text {H}\Big ) \right| _{x=0}, \end{aligned}$$
(B.14)

and

$$\begin{aligned} \left. C^n_\text {H} \right| _{x = L}&= H_L, \quad \left. C^n_\text {I} \right| _{x = L} = I_L, \end{aligned}$$
(B.15)
$$\begin{aligned} \left. C^n_\text {B} \right| _{x = L}&= B_L, \quad \left. C^n_\text {A} \right| _{x = L} = A_L. \end{aligned}$$
(B.16)

Solving Eqs. (B.6) to (B.10) subject to boundary conditions given by Eqs. (B.11) to (B.16) determines the n-th iterate for each concentration and the electric potential. We then update \(C^*_i\) to be equal to \(C^n_i\) and repeat. This process converges when solving the system yields new iterates which are equal to the previous (\(C^n_i = C^*_i\)), which gives a solution to the non-linear steady state problem Eqs. (B.1) to (B.5).

C Spatial discretization

Here we outline the discretization that is utilized to approximate the system of Eqs. (B.6) to (B.10). Our discretization is derived from a standard finite difference and finite volume schemes. We begin by discretizing space using a so-called “staggered grid”. Two collections of spatial points are defined, and various quantities more naturally “live” at each. The first collection of points we refer to as “cell edges,” and they are defined by

$$\begin{aligned} x_j = j \, \Delta x \quad j = 0, 1, \ldots N \end{aligned}$$
(C.1)

where \(\Delta x = L/N\) is the spatial resolution of the grid. The second collection of points are referred to as “cell centers” and are defined by

$$\begin{aligned} x_j = j \, \Delta x \quad j = \frac{-1}{2}, \frac{1}{2}, \frac{3}{2} \ldots N+\frac{1}{2}. \end{aligned}$$
(C.2)

There are in total \(N+1\) cell edges and \(N+2\) cell centers, but not all correspond to spatial locations within our domain. The cell edges \(x_0\) and \(x_N\), as well as the cell centers \(x_{1/2}\) and \(x_{N+1/2}\) lie either at or outside the boundary of the computational domain. These are often called “ghost points”, and quantities located at them are a numerical convenience used to help enforce boundary conditions but may not necessarily correspond to a physical quantity. All other points lie within the domain and will be referred to as interior cell centers and interior cell edges. A schematic of the spatial discretization is shown in Fig. 13.

Fig. 13
figure 13

A schematic representation of our computational grid for \(N = 5\). Dashed vertical black lines indicate the boundaries of the computational domain. Circles indicate cell centers, while diamonds indicate cell edges. Interior points are drawn with solid lines while ghost points are drawn with dash-dot lines

We approximate ionic concentrations at cell centers. Where necessary, we use a second subscript j to denote the spatial location where an approximation takes place, while a superscript n denotes n-th iterate of our relaxation scheme.

$$\begin{aligned} C^{n}_{\text {i}, \, j}\approx C^n_i(x_j), \quad i = \text {H},\text {B},\text {A},\text {I}. \end{aligned}$$
(C.3)

Finally, we introduce the quantity \(\Phi \) to approximate the electric potential gradient. This quantity “lives” at cell edges (\(j = 0, 1, \ldots N\)).

$$\begin{aligned} \Phi ^{n}_j\approx \nabla \Psi ^n(x_j). \end{aligned}$$
(C.4)

To approximate the Nernst–Planck type equation at interior cell centers, we use standard finite-difference and finite volume discretizations for all linear terms. The advective flux is treated with a standard upwinding scheme, while the diffusive flux is treated with a standard second order, variable coefficient, finite difference scheme (Leveque 2007). In the interest of notational compactness, we utilize similar notation to denote the solvent velocity (u(x)) and volume fraction (\(\theta _s(x)\)) at various spatial locations, though no approximation is necessary as we can simply evaluate the given functions.

We are now able to discretize Eqs. (B.6) to (B.9) for each of the four ionic species, at each interior cell center (\(j = 1/2, 3/2, \ldots N-1/2\)):

$$\begin{aligned}&\frac{ u_{j+1/2}C^{n}_{\text {H},\, j} - u_{j-1/2} C^{n}_{\text {H},\,j-1} }{\Delta x} \nonumber \\&\quad =\frac{D_\text {H}}{\theta _{s,\,j} \Delta x^2} \left( \left( \theta _{s, \, j-1/2}\right) C^{n}_{\text {H}, \, j-1} - \left( \theta _{s, \, j-1/2} + \theta _{s, \, j+1/2}\right) C^{n}_{\text {H},\, j} + \left( \theta _{s, \, j+1/2}\right) C^{n}_{\text {H}, \, j+1} \right) \nonumber \\&\qquad + \frac{D_\text {H}z_\text {H}}{ \theta _{s,\, j} \Delta x} \left( \theta _{s, \, j+1/2} \left( \frac{ C^{*}_{\text {H}, \,j+1} + C^{*}_{\text {H}, \, j}}{2}\right) \Phi ^{n}_{j+1/2} - \theta _{s, \, j-1/2}\left( \frac{ C^{*}_{\text {H}, \, j} + C^{*}_{\text {H}, \, j-1}}{2}\right) \Phi ^{n}_{j-1/2}\right) \nonumber \\&\qquad + S(x_j) - \kappa C^{n}_{\text {H}, \, j} C^{*}_{B,\,j}, \end{aligned}$$
(C.5)
$$\begin{aligned}&\frac{ u_{j+1/2}C^{n}_{\text {B},\, j} - u_{j-1/2} C^{n}_{\text {B},\,j-1} }{\Delta x} \nonumber \\&\quad =\frac{D_\text {B}}{\theta _{s,\,j} \Delta x^2} \left( \left( \theta _{s, \, j-1/2}\right) C^{n}_{\text {B}, \, j-1} - \left( \theta _{s, \, j-1/2} + \theta _{s, \, j+1/2}\right) C^{n}_{\text {B},\, j} + \left( \theta _{s, \, j+1/2}\right) C^{n}_{\text {B}, \, j+1} \right) \nonumber \\&\qquad + \frac{D_\text {B}z_\text {B}}{ \theta _{s,\, j} \Delta x} \left( \theta _{s, \, j+1/2} \left( \frac{ C^{*}_{\text {B}, \,j+1} + C^{*}_{\text {B}, \, j}}{2}\right) \Phi ^{n}_{j+1/2} - \theta _{s, \, j-1/2}\left( \frac{ C^{*}_{\text {B}, \, j} + C^{*}_{\text {B}, \, j-1}}{2}\right) \Phi ^{n}_{j-1/2}\right) \nonumber \\&\qquad - \kappa C^{n}_{\text {B}, \, j} C^{*}_{\text {H},\,j}, \end{aligned}$$
(C.6)
$$\begin{aligned}&\frac{ u_{j+1/2}C^{n}_{\text {A},\, j} - u_{j-1/2} C^{n}_{\text {A},\,j-1} }{\Delta x} \nonumber \\&\quad =\frac{D_\text {A}}{\theta _{s,\,j} \Delta x^2} \left( \left( \theta _{s, \, j-1/2}\right) C^{n}_{\text {A}, \, j-1} - \left( \theta _{s, \, j-1/2} + \theta _{s, \, j+1/2}\right) C^{n}_{\text {A},\, j} + \left( \theta _{s, \, j+1/2}\right) C^{n}_{\text {A}, \, j+1} \right) \nonumber \\&\qquad + \frac{D_\text {A}z_\text {A}}{ \theta _{s,\, j} \Delta x} \left( \theta _{s, \, j+1/2} \left( \frac{ C^{*}_{\text {A}, \,j+1} + C^{*}_{\text {A}, \, j}}{2}\right) \Phi ^{n}_{j+1/2} - \theta _{s, \, j-1/2}\left( \frac{ C^{*}_{\text {A}, \, j} + C^{*}_{\text {A}, \, j-1}}{2}\right) \Phi ^{n}_{j-1/2}\right) \nonumber \\&\qquad + S(x_j), \end{aligned}$$
(C.7)
$$\begin{aligned}&\frac{ u_{j+1/2}C^{n}_{\text {I},\, j} - u_{j-1/2} C^{n}_{\text {I},\,j-1} }{\Delta x} \nonumber \\&\quad =\frac{D_\text {I}}{\theta _{s,\,j} \Delta x^2} \left( \left( \theta _{s, \, j-1/2}\right) C^{n}_{\text {I}, \, j-1} - \left( \theta _{s, \, j-1/2} + \theta _{s, \, j+1/2}\right) C^{n}_{\text {I},\, j} + \left( \theta _{s, \, j+1/2}\right) C^{n}_{\text {I}, \, j+1} \right) \nonumber \\&\qquad + \frac{D_\text {I}z_\text {I}}{ \theta _{s,\, j} \Delta x} \left( \theta _{s, \, j+1/2} \left( \frac{ C^{*}_{\text {I}, \,j+1} + C^{*}_{\text {I}, \, j}}{2}\right) \Phi ^{n}_{j+1/2} - \theta _{s, \, j-1/2}\left( \frac{ C^{*}_{\text {I}, \, j} + C^{*}_{\text {I}, \, j-1}}{2}\right) \Phi ^{n}_{j-1/2}\right) .\nonumber \\ \end{aligned}$$
(C.8)

We also discretize the boundary conditions for each species in a similar manner. To approximate ionic species at a boundary, we utilize linear interpolation (in space) using ghost points and the first interior cell center. At the left boundary of our domain (where \(j = 0\)) we have the following equations:

$$\begin{aligned}&k_\text {HI} \left( \frac{C^{n}_{\text {I}, \, -1/2} + C^{n}_{\text {I},\,1/2}}{2} - \delta _\text {HI} \frac{C^{n}_{\text {H}, \ -1/2} + C^{n}_{\text {H}, \, 1/2}}{2}\right) \nonumber \\&\quad = - \frac{D_\text {H}}{\Delta x} \left( C^{n}_{\text {H}, \,1/2} - C^{n}_{\text {H}, \, -1/2} \right) + u_{0} C^{n}_{\text {H}, \, -1/2} - D_\text {H} z_\text {H}\left( \frac{ C^{*}_{\text {H}, \, -1/2} + C^{*}_{\text {H}, \, 1/2}}{2} \right) \Phi ^{n}_{0} ,\nonumber \\ \end{aligned}$$
(C.9)
$$\begin{aligned}&- k_\text {HI} \left( \frac{C^{n}_{\text {I}, \, -1/2} + C^{n}_{\text {I},\,1/2}}{2} - \delta _\text {HI} \frac{C^{n}_{\text {H}, \ -1/2} + C^{n}_{\text {H}, \, 1/2}}{2}\right) \nonumber \\&\quad = - \frac{D_\text {I}}{\Delta x} \left( C^{n}_{\text {I}, \,1/2} - C^{n}_{\text {I}, \, -1/2} \right) + u_{0} C^{n}_{\text {I}, \, -1/2} - D_\text {I} z_\text {I}\left( \frac{ C^{*}_{\text {I}, \, -1/2} + C^{*}_{\text {I}, \, 1/2}}{2} \right) \Phi ^{n}_{0} , \end{aligned}$$
(C.10)
$$\begin{aligned}&k_\text {AB} \left( \frac{C^{n}_{\text {A}, \, -1/2} + C^{n}_{\text {A},\,1/2}}{2} - \delta _\text {AB} \frac{C^{n}_{\text {B}, \ -1/2} + C^{n}_{\text {B}, \, 1/2}}{2}\right) \nonumber \\&\quad = - \frac{D_\text {B}}{\Delta x} \left( C^{n}_{\text {B}, \,1/2} - C^{n}_{\text {B}, \, -1/2} \right) + u_{0} C^{n}_{\text {B}, \, -1/2} - D_\text {B} z_\text {B}\left( \frac{ C^{*}_{\text {B}, \, -1/2} + C^{*}_{\text {B}, \, 1/2}}{2} \right) \Phi ^{n}_{0} ,\nonumber \\ \end{aligned}$$
(C.11)
$$\begin{aligned}&-k_\text {AB} \left( \frac{C^{n}_{\text {A}, \, -1/2} + C^{n}_{\text {A},\,1/2}}{2} - \delta _\text {AB} \frac{C^{n}_{B, \ -1/2} + C^{n}_{B, \, 1/2}}{2}\right) \nonumber \\&\quad = - \frac{D_\text {A}}{\Delta x} \left( C^{n}_{\text {A}, \,1/2} - C^{n}_{\text {A}, \, -1/2} \right) + u_{0} C^{n}_{\text {A}, \, -1/2} - D_\text {A} z_\text {A}\left( \frac{ C^{*}_{\text {A}, \, -1/2} + C^{*}_{\text {A}, \, 1/2}}{2} \right) \Phi ^{n}_{0} .\nonumber \\ \end{aligned}$$
(C.12)

The boundary conditions at the right are significantly simpler:

$$\begin{aligned}&\frac{ C^{n}_{\text {H}, \, N-1/2} +C^{n}_{\text {H}, \, N+1/2}}{2} = H_L, \end{aligned}$$
(C.13)
$$\begin{aligned}&\frac{ C^{n}_{B, \, N-1/2} +C^{n}_{\text {B}, \, N+1/2}}{2} = B_L, \end{aligned}$$
(C.14)
$$\begin{aligned}&\frac{ C^{n}_{\text {A}, \, N-1/2} +C^{n}_{\text {A}, \, N+1/2}}{2} = A_L, \end{aligned}$$
(C.15)
$$\begin{aligned}&\frac{ C^{n}_{\text {I}, \, N-1/2} +C^{n}_{\text {I}, \, N+1/2}}{2} = I_L, \end{aligned}$$
(C.16)

Finally, we have a set of discrete equations which enforce the electro-neutrality constraint at the the interior cell centers (\(j = 1/2, 3/2, \ldots N-1/2\)) as well as the ghost point corresponding to  \(j = -1/2\).

$$\begin{aligned} z_H C^{n}_{\text {H}, \, j }+ z_BC^{n}_{\text {B}, \, j } + z_A C^{n}_{\text {A}, \, j } + z_I C^{n}_{\text {I}, \, j } = 0, \quad j = -1/2, 1/2, \ldots N-1/2.\nonumber \\ \end{aligned}$$
(C.17)

We enforce the electro-neutrality constraint at the left most ghost point even though the concentrations at this point do not represent physical quantities. This is done to ensure that (up to linear approximation), the electro-neutrality constraint is satisfied up to and including the left boundary. We do not need a similar equation at the right boundary because Eqs. (C.13) to (C.16) together with choosing \(H_L\), \(B_L\), \(A_L\) and \(I_L\) in a manner satisfying electro-neturality implies this condition is already met.

Now, from a previous iteration (or an initial guess), we know the concentrations \(C^{*}_{i, \, j}\), for \(j = -1/2, 1/2, \ldots N+1/2\) and \(i = \text {H},\text {I},\text {A},\text {B}\). This implies that eqs. (C.21) to (C.33) represent a \(5N+9 \times 5N+9\) system of linear equations which may be solved for concentrations and the potential gradient (simultaneously) at the next iteration (\(C^{n}_{i, \, j}\) and \(\Phi ^{n}_{j}\)).

1.1 C.1 Convergence criteria

To calculate the steady state ion concentrations, the numerical discretization and relaxation scheme outlined above are iterated. This produces a sequence of approximate ion concentrations

$$\begin{aligned} C_{i,j}^1, C^2_{i,j}, \ldots C_{i,j}^n.\end{aligned}$$

After n iterations, the error associated with ion i is approximated by

$$\begin{aligned} E_i(n) = \max _{j = -1/2, 1/2, \ldots N+1/2}\left| C^n_{i,j} - C^{n-1}_{i,j}\right| . \end{aligned}$$
(C.18)

We stop iteration when the maximum error (over all ion species) is less than a specified tolerace

$$\begin{aligned} \max _{i = \text { H, I, B, A}} E_i(n) < \delta . \end{aligned}$$
(C.19)

In the results reported here, we used a tolerance of \(\delta = 5 \times 10^{-10}\).

1.2 D Calculation of Sobol indices

Using the notation from Saltelli et al. (2010), we begin with generating two independent sampling matrices \({\mathbf {A}}\) and \({\mathbf {B}}\), each of size \(s \times N\), where s is the number of samples and N is the number of parameters. Hence, each row represents a sample and each column represents a parameter. We define a matrix \({\mathbf {A}}_{{\mathbf {B}}}^{(i)}\) where all columns are from \({\mathbf {A}}\) except the i-th column which is from \({\mathbf {B}}\). Then, the total Sobol’ index for the parameter \(p_i\) is estimated by,

$$\begin{aligned} \widehat{\overline{{\mathcal {S}}}_i} = \dfrac{1}{2s} \sum _{j = 1}^{s} \left( f({\mathbf {A}})_j - f({\mathbf {A}}_{\mathbf {B}}^{(i)})_j\right) ^2, \end{aligned}$$
(D.36)

where, \(f({\mathbf {A}})_j\) is the QoI for the parameters corresponding to the j-th row of the matrix \({\mathbf {A}}\) and \(f({\mathbf {A}}_{\mathbf {B}}^{(i)})_j\) is the QoI for the parameters corresponding to the j-th row of the matrix \({\mathbf {A}}_{{\mathbf {B}}}^{(i)}\).

To estimate the first-order SI, we implemented the “Correlation 2” scheme proposed in Owen (2013). This scheme uses three independent sampling matrices \({\mathbf {A}}\), \({\mathbf {B}}\), and \({\mathbf {C}}\). Using the above notation, the estimator is defined by,

$$\begin{aligned} \widehat{\underline{{\mathcal {S}}}_i} = \dfrac{1}{s} \sum _{j = 1}^{s} \left( f({\mathbf {A}})_j - f({\mathbf {A}}_{\mathbf {C}}^{(i)})_j\right) \left( f({\mathbf {B}}_{\mathbf {A}}^{(i)})_j - f({\mathbf {B}})_j\right) , \end{aligned}$$
(D.37)

where, \(f({\mathbf {A}}_{\mathbf {C}}^{(i)})_j\) is the QoI for the parameters corresponding to the j-th row of the matrix \({\mathbf {A}}_{{\mathbf {C}}}^{(i)}\). Following our terminology, \({\mathbf {A}}_{{\mathbf {C}}}^{(i)}\) is the matrix where all columns are from \({\mathbf {A}}\) except the i-th column, which is from the third independent matrix \({\mathbf {C}}\). To sample the parameter space we use Sobol’ sequences, which are quasi-random sequences that have been shown to give a uniform distribution with low discrepancy in high-dimensional spaces (Sobol et al. 2011). To reduce the computation time of the QoI for a sample, custom sparse arrays based on compressed sparse row format were developed to represent the discretized equations (Eqs. (C.5) to (C.17)). The resulting system of equations was solved using the sparse linear solver scipy.sparse.linalg.spsolve (with permc_spec=MMD_AT_PLUS_A). Further, rather than using a static number of samples for the estimation of SI, we define a convergence criterion to dynamically select the number of samples to estimate the SI of each parameter.

The estimated SI is updated with every new sample in the parameter space. This gives us a statistical distribution of the updates of the estimated SI. We define the convergence of SI if the standard deviation of this distribution, over the last k updates (we call this the batch size), is less than a tolerance tol. If the model is well-behaved in the parameter regime, we expect the estimated SIs to converge as we include more samples. Hence, we expect that the standard deviation of the last batch of k number of updates of the SI will be considerably low. Figure 14 shows the convergence of the estimated SIs for the model in this study in the full parameter regime. If we decrease tol, more number of updates are required for convergence of SI of some of the parameters, without a significant change in the estimated SI.

Finally, for faster computation, the QoIs required for the updates of an entire batch (defined by k) are computed in parallel using the package joblib in Python.

Fig. 14
figure 14

Convergence plots for total SI estimates, when all of the parameters are considered when a tol \(= 0.02\) and b tol \(= 0.01\), both with batch size \(k=2000\). At the lower tol value, some of the parameters take a greater number of updates for convergence. Note that the number of updates required for convergence for a parameter will always be a multiple of the batch size k

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Aggarwal, M., Cogan, N.G. & Lewis, O.L. Physiological insights into electrodiffusive maintenance of gastric mucus through sensitivity analysis and simulations. J. Math. Biol. 83, 30 (2021). https://doi.org/10.1007/s00285-021-01643-w

Download citation

  • Received:

  • Revised:

  • Accepted:

  • Published:

  • DOI: https://doi.org/10.1007/s00285-021-01643-w

Keywords

Mathematics Subject Classification

Navigation