Skip to main content
Log in

Simple Finite Element Methods for Approximating Predator–Prey Dynamics in Two Dimensions Using Matlab

  • Education Article
  • Published:
Bulletin of Mathematical Biology Aims and scope Submit manuscript

Abstract

We describe simple finite element schemes for approximating spatially extended predator–prey dynamics with the Holling type II functional response and logistic growth of the prey. The finite element schemes generalize ‘Scheme 1’ in the paper by Garvie (Bull Math Biol 69(3):931–956, 2007). We present user-friendly, open-source Matlab code for implementing the finite element methods on arbitrary-shaped two-dimensional domains with Dirichlet, Neumann, Robin, mixed Robin–Neumann, mixed Dirichlet–Neumann, and Periodic boundary conditions. Users can download, edit, and run the codes from http://www.uoguelph.ca/~mgarvie/. In addition to discussing the well posedness of the model equations, the results of numerical experiments are presented and demonstrate the crucial role that habitat shape, initial data, and the boundary conditions play in determining the spatiotemporal dynamics of predator–prey interactions. As most previous works on this problem have focussed on square domains with standard boundary conditions, our paper makes a significant contribution to the area.

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

Notes

  1. See the paper by Garvie and Trenchea (2010) for details of the nondimensionalization procedure.

  2. The requirement \(g_u>0,\,g_v>0\) is necessary to avoid possible (nonphysical) negative solutions as \(t\rightarrow \infty \).

  3. A typical basis function is illustrated in many textbooks on the finite element method (e.g. (Johnson (2009), p. 29)).

  4. The unstructured grids can be generated using any other suitable meshing software, for example, MESH2D available at http://www.mathworks.com/matlabcentral/fileexchange/.

  5. See the paper by Sherratt and Smith (2008) for a biological motivation.

  6. If the metapopulation dynamics are synchronous, then the dynamics in different patches are the same.

  7. The full working for the assembly of these matrices was set as part of a project for a graduate course in Numerical Analysis (‘Math*6400’) at the University of Guelph, ON, Canada.

References

  • Adams R (1975) Sobolev spaces. Pure and applied mathematics. Academic Press, New York

    Google Scholar 

  • Ahmed M, Fiedler L (2002) A comparison of four rodent control methods in Philippine experimental rice fields. Int Biodeterior Biodegrad 49(2–3):125–132

    Article  Google Scholar 

  • Alberty J, Carstensen C, Funken S (1999) Remarks around 50 lines of Matlab: short finite element implementation. Numer Algorithms 20(2–3):117–137

    Article  MathSciNet  MATH  Google Scholar 

  • Barrett J, Blowey J (1996) An error bound for the finite element approximation of a model for phase separation of a multi-component alloy. IMA J Numer Anal 16(2):257–287

    Article  MathSciNet  MATH  Google Scholar 

  • Barrett J, Elliott C (1986) Finite element approximation of the Dirichlet problem using the boundary penalty method. Numer Math 49:343–366

    Article  MathSciNet  MATH  Google Scholar 

  • Bassiri E, Bryant R, George M, Yerion K (2009) A finite difference method for modeling the formation of animal coat patterns. Nonlinear Anal Real World Appl 10(3):1730–1737

    Article  MathSciNet  MATH  Google Scholar 

  • Bittihn P, Squires A, Luther G, Bodenschatz E, Krinsky V, Parlitz U, Luther S (2010) Phase-resolved analysis of the susceptibility of pinned spiral waves to far-field pacing in a two-dimensional model of excitable media. Phil Trans R Soc A 368:2221–2236

    Article  MathSciNet  MATH  Google Scholar 

  • Blowey J, Elliott C (1992) The Cahn–Hilliard gradient theory for phase separation with nonsmooth free energy. Part II. Numerical analysis. Eur J Appl Math 3(2):147–179

    Article  MathSciNet  MATH  Google Scholar 

  • Brenner S, Scott L (1994) The mathematical theory of finite element methods. Vol. 15 of texts in applied mathematics. Springer, New York

    Book  Google Scholar 

  • Cantrell R, Cosner C (2003) Spatial ecology via reaction–diffusion equations. Wiley series in mathematical and computational biology. Wiley, Chichester

  • Cantrell R, Cosner C, Fagan W (1998) Competitive reversals inside ecological reserves: the role of external habitat degradation. J Math Biol 37:491–533

    Article  MathSciNet  MATH  Google Scholar 

  • Chaplain M, Ganesh M, Graham I (2001) Spatio-temporal pattern formation on spherical surfaces: numerical simulation and application to solid tumour growth. J Math Biol 42:387–423

    Article  MathSciNet  MATH  Google Scholar 

  • Ciarlet P (1979) The finite element method for elliptic problems. Vol. 4 of studies in mathematics and its applications. North-Holland, Amsterdam

    Google Scholar 

  • Crank N, Nicolson P (1947) A practical method for numerical evaluation of solutions of partial differential equations of the heat conduction type. Proc Camb Phil Soc 43:50–67

    Article  MathSciNet  MATH  Google Scholar 

  • Dawes J, Souza M (2013) A derivation of Hollings type I, II and III functional responses in predator–prey systems. J Theor Biol 327:11–22

    Article  MathSciNet  Google Scholar 

  • Descalzi O, Brand H (2008) Influence of boundary conditions on localized solutions of the cubic-quintic complex Ginzburg–Landau equation. Prog Theor Phys 119(5):725–738

    Article  Google Scholar 

  • Diele F, Marangi C, Ragni S (2014) IMSP schemes for spatially explicit models of cyclic populations and metapopulation dynamics. Math Comput Simul 100:41–53

    Article  MathSciNet  Google Scholar 

  • Ding Y, Kawahara M (1998) Analysis of dynamic response of prey–predator system with nonlinear diffusion–reaction equations by using superposition. Comput Methods Appl Mech Eng 156:375–388

    Article  MathSciNet  MATH  Google Scholar 

  • Dubois D (1975) A model of patchiness for prey–predator plankton populations. Ecol Model 1:67–80

    Article  Google Scholar 

  • Edelstein-Keshet L (2005) Mathematical models in biology. Vol. 46 of classics in applied mathematics. Society for Industrial and Applied Mathematics (SIAM), Philadelphia

    Google Scholar 

  • Evans L (1998) Partial differential equations. American Mathematical Society, Providence

    MATH  Google Scholar 

  • Fagan W, Cantrell R, Cosner C (1999) How habitat edges change species interaction. Am Nat 153(2):165–182

    Article  Google Scholar 

  • Falconer K (1990) Fractal geometry. Wiley, Chichester

    MATH  Google Scholar 

  • Friedman A (2012) PDE problems arising in mathematical biology. Netw Heterog Media 7(4):691–703

    Article  MathSciNet  MATH  Google Scholar 

  • Garvie M (2007) Finite difference schemes for reaction–diffusion equations modelling predator–prey interactions in MATLAB. Bull Math Biol 69(3):931–956

    Article  MathSciNet  MATH  Google Scholar 

  • Garvie M, Blowey J (2005) A reaction–diffusion system of \(\lambda -\omega \) type. Part II: numerical analysis. Eur J Appl Math 16(5):621–646

    Article  MathSciNet  MATH  Google Scholar 

  • Garvie M, Trenchea C (2007) Finite element approximation of spatially extended predator–prey interactions with the Holling type II functional response. Numer Math 107:641–667

    Article  MathSciNet  MATH  Google Scholar 

  • Garvie M, Trenchea C (2010) Spatiotemporal dynamics of two generic predator–prey models. J Biol Dyn 4(6):559–570

    Article  MathSciNet  Google Scholar 

  • Garvie M, Morgan J, Sharma V, (2014) A fully spatially structured metapopulation model for predator–prey dynamics in \(d\le 3\) space dimensions. (submitted)

  • Grossmann C, Roos H-G, Stynes M (2007) Numerical treatment of partial differential equations. Springer, Berlin

    Book  MATH  Google Scholar 

  • Gurney W, Veitch A, Cruickshank I, McGeachin G (1998) Circles and spirals: population persistence in a spatially explicit predator–prey model. Ecology 79(7):2516–2530

    Google Scholar 

  • Hilker F, Malchow H, Langlais M, Petrovskii S (2006) Oscillations and waves in a virally infected plankton system part II: transition from lysogeny to lysis. Ecol Complex 3:200–208

    Article  Google Scholar 

  • Holden A, Markus M, Othmer H (eds) (1991) Nonlinear wave processes in excitable media. Plenum, New York

    MATH  Google Scholar 

  • Holling C (1959) Some characteristics of simple types of predation and parasitism. Can Entomol 91:385–398

    Article  Google Scholar 

  • Holmes E, Lewis M, Banks J, Veit R (1994) Partial differential equations in ecology: spatial interactions and population dynamics. Ecology 75(1):17–29

    Article  Google Scholar 

  • Jansen V (2001) The dynamics of two diffusively coupled predator–prey populations. Theor Popul Ecol 59:119–131

    Article  MATH  Google Scholar 

  • Johnson C (2009) Numerical solution of partial differential equations by the finite element method. Dover, Mineola

    MATH  Google Scholar 

  • Kaipio J, Tervo J, Vauhkonen M (1995) Simulations of the heterogeneity of environments by finite elements. Math Comput Simul 39:155–172

    Article  MathSciNet  Google Scholar 

  • Ladyz̆enskaja O, Solonikov V, Ural’ceva N (1968) Linear and quasilinear equations of parabolic type. Vol. 23 of translations of mathematical monographs. American Mathematical Society, Providence

    Google Scholar 

  • Larsson S, Thomée V (2009) Partial differential equations with numerical methods. Vol. 45 of texts in applied mathematics. Springer, Berlin

    Google Scholar 

  • Leung A (1982) A semilinear reaction–diffusion prey–predator system with nonlinear coupled boundary conditions: equilibrium and stability. Indiana Univ Math J 31(2):223–241

    Article  MathSciNet  MATH  Google Scholar 

  • Maciel G, Lutscher F (2013) How individual movement response to habitat edges affects population persistence and spatial spread. Am Nat 182(1):42–52

    Article  Google Scholar 

  • Malchow H, Petrovskii S (2002) Dynamical stabilization of an unstable equilibrium in chemical and biological systems. Math Comput Model 36:307–319

    Article  MathSciNet  MATH  Google Scholar 

  • Malchow H, Radtke B, Kallache M, Medvinsky A, Tikhonov D, Petrovskii S (2000) Spatio-temporal pattern formation in coupled models of plankton dynamics and fish school motion. Nonlinear Anal-Real 1:53–67

    Article  MathSciNet  MATH  Google Scholar 

  • Malchow H, Petrovskii S, Medvinsky A (2002) Numerical study of plankton–fish dynamics in a spatially structured and noisy environment. Ecol Model 149:247–255

    Article  Google Scholar 

  • Malchow H, Hilker F, Petrovskii S, Brauer K (2004) Oscillations and waves in a virally infected plankton system part I: the lysogenic stage. Ecol Complex 1:211–223

    Article  Google Scholar 

  • Malchow H, Petrovskii S, Venturino E (2008) Spatiotemporal patterns in ecology and epidemiology: theory, models, and simulation. Vol. 17 of mathematical & computational biology. Chapman & Hall/CRC, Boca Raton

    Google Scholar 

  • Malpas L, Kennerley R, Hirons G, Sheldon R, Ausden M, Gilbert J, Smart J (2013) The use of predator-exclusion fencing as a management tool improves the breeding success of waders on lowland wet grassland. J Nat Conserv 21:37–47

    Article  Google Scholar 

  • May R (1974) Stability and complexity in model ecosystems. Princeton University Press, New Jersey

    Google Scholar 

  • Medvinsky A, Petrovskii S, Tikhonova I, Malchow H, Li B-L (2002) Spatiotemporal complexity of plankton and fish dynamics. SIAM Rev 44(3):311–370

    Article  MathSciNet  MATH  Google Scholar 

  • Meinhardt H (1982) Models of biological pattern formation. Academic Press, New York

    Google Scholar 

  • Murray J (1981) On pattern formation mechanisms for lepidopteran wing patterns and mammalian coat markings. Phil Trans R Soc Lond B 295:473–496

    Article  Google Scholar 

  • Murray J (2002) Mathematical biology I: an introduction, 3rd edition. Vol. 17 of interdisciplinary applied mathematics. Springer, New York

    Google Scholar 

  • Murray J (2003) Mathematical biology II: spatial models and biomedical applications, 3rd edition. Vol. 18 of interdisciplinary applied mathematics. Springer, New York

    Google Scholar 

  • Pascual M (1993) Diffusion-induced chaos in a spatial predator–prey system. Proc R Soc Lond B 251:1–7

    Article  Google Scholar 

  • Peacock-Lopez E (2011) The relevance of cross-diffusion in the formation of Turing patterns. Nonlinear Dyn Psychol Life Sci 15(1):1–10

    MathSciNet  Google Scholar 

  • Segel L, Jackson J (1972) Dissipative structure: an explanation and an ecological example. J Theor Biol 37:545–559

    Article  Google Scholar 

  • Shangerganesh L, Balachandran K (2011) Existence and uniqueness of solutions of predator–prey type model with mixed boundary conditions. Acta Appl Math 116:71–86

    Article  MathSciNet  MATH  Google Scholar 

  • Sherratt J (2001) Periodic travelling waves in cyclic predator–prey systems. Ecol Lett 4:30–37

    Article  Google Scholar 

  • Sherratt J (2003) Periodic travelling wave selection by Dirichlet boundary conditions in oscillatory reaction–diffusion systems. SIAM J Appl Math 63(5):1520–1538

    Article  MathSciNet  MATH  Google Scholar 

  • Sherratt J (2008) A comparison of periodic travelling wave generation by Robin and Dirichlet boundary conditions in oscillatory reaction–diffusion equations. IMA J Appl Math 73(5):759–781

    Article  MathSciNet  MATH  Google Scholar 

  • Sherratt J, Smith M (2008) Periodic travelling waves in cyclic populations: field studies and reaction–diffusion models. J R Soc Interface 5:483–505

    Article  Google Scholar 

  • Sherratt J, Eagan B, Lewis M (1997) Oscillations and chaos behind predator–prey invasion: mathematical artifact or ecological reality? Phil Trans R Soc Lond B 352:21–38

    Article  Google Scholar 

  • Sherratt J, Lambin X, Thomas C, Sherratt T (2002) Generation of periodic waves by landscape features in cyclic predator–prey systems. Proc R Soc Lond B 269:327–334

    Article  Google Scholar 

  • Sherratt J, Lambin X, Sherratt T (2003) The effects of the size and shape of landscape features on the formation of travelling waves in cyclic populations. Am Nat 162:503–513

    Article  Google Scholar 

  • Smith M, Sherratt J, Armstrong N (2008) The effects of obstacle size on periodic travelling waves in oscillatory reaction–diffusion equations. Proc R Soc A 464:365–390

    Article  MathSciNet  MATH  Google Scholar 

  • Smith M, Rademacher J, Sherratt J (2009) Absolute stability of wavetrains can explain spatiotemporal dynamics in reaction–diffusion systems of Lambda–Omega type. SIAM J Appl Dyn Syst 8(3):1136–1159

    Article  MathSciNet  MATH  Google Scholar 

  • Smoller J (1983) Shock waves and reaction–diffusion equations. Vol. 258 of Grundlehren der mathematischen Wissenschaften. Springer, New York

    Google Scholar 

  • Strang G, Fix G (1973) An analysis of the finite element method. Prentice-Hall, Englewood Cliffs

    MATH  Google Scholar 

  • Temam R (1997) Infinite-dimensional dynamical systems in mechanics and physics. Vol. 68 of applied mathematical sciences. Springer, New York

    Book  Google Scholar 

  • Thomée V (2006) Galerkin finite element methods for parabolic problems, 2nd ed. Vol. 25 of Springer series in computational mathematics. Springer, Berlin

  • Tilman D, Kareiva P (1997) Spatial ecology: the role of space in population dynamics and interspecific interactions. Vol. 30 of monographs in population biology. Princeton University Press, Princeton

    Google Scholar 

  • Yun A, Shin J, Li Y, Kim J (2011) Numerical study of periodic travelling wave solutions for the predator–prey model with landscape features. (submitted)

Download references

Acknowledgments

We are thankful for the comments of the handling editor and an anonymous reviewer that improved the accuracy and clarity of the paper. The research of M. Garvie was supported by a Natural Sciences and Engineering Research Council of Canada (NSERC) Discovery Grant # 400159 and the research of J. Morgan was supported by a National Science Foundation (NSF) Grant DMS-0714864.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Marcus R. Garvie.

Appendix: Assembly of the Matrix \(K\) and \(L\)

Appendix: Assembly of the Matrix \(K\) and \(L\)

Consider a generic triangle \(\tau \) with nodes labelled \(P_i\), \(P_j\), and \(P_k\), with coordinates \((x_i,y_i)\), \((x_j,y_j)\) and \((x_k,y_k)\), respectively. Then, the linear basis function associated with node \(P_k\) can be expressed asFootnote 7

$$\begin{aligned} \varphi _k(x,y): = \frac{h_{ji}(x,y)}{h_{ji}(x_k,y_k)}, \quad \text{ where }\quad h_{ji}(x,y): = (x-x_i)(y_j-y_i) - (x_j-x_i)(y-y_i), \end{aligned}$$

(\(h_{ji}(x_k,y_k)\ne 0\)), and the basis functions for the other nodes are defined analogously. Now as the gradient of the basis functions are constant on each triangle \(\tau \), all contributions to the Stiffness matrix \(K\) have the form \(\int _\tau \nabla \varphi _s\cdot \nabla \varphi _p\,\mathrm{d}\mathbf{x} = \nabla \varphi _s\cdot \nabla \varphi _p |\tau |\), where the area of the triangle \(\tau \) is given by \(|\tau | = | x_j y_k-x_k y_j-x_i y_k+x_k y_i+x_i y_j-x_j y_i |/2\). Elementary calculations yield

$$\begin{aligned} \nabla \varphi _k\cdot \nabla \varphi _i = \frac{(y_j-y_i)(y_k-y_j)+(x_i-x_j)(x_j-x_k)}{h_{ji}(x_k,y_k) h_{kj}(x_i,y_i)}, \end{aligned}$$

with similar expressions obtained for \(\nabla \varphi _k\cdot \nabla \varphi _j\), \(\nabla \varphi _i\cdot \nabla \varphi _j\), \(|\nabla \varphi _k|^2\), \(|\nabla \varphi _i|^2\) and \(|\nabla \varphi _j|^2\). The contributions to the matrix \(L:=\widehat{M}^{-1}K\) are readily calculated after noting \(\int _\tau \varphi _i\,\mathrm{d}\mathbf{x} = \frac{1}{3}|\tau |\), where we used the fact that the volume of a tetrahedron is a third of the base area times the height.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Garvie, M.R., Burkardt, J. & Morgan, J. Simple Finite Element Methods for Approximating Predator–Prey Dynamics in Two Dimensions Using Matlab . Bull Math Biol 77, 548–578 (2015). https://doi.org/10.1007/s11538-015-0062-z

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s11538-015-0062-z

Keywords

Navigation