fd1d_predator_prey


fd1d_predator_prey, a Fortran77 code which solves a predator-prey system in a one dimensional region, by Marcus Garvie.

The nondimensional problem has the form

        du/dt =         del u + ( 1 - u ) * u        - v * h(u/alpha)

        dv/dt = delta * del v     - gamma * v + beta * v * h(u/alpha)
      
with initial conditions:
        u(x,0) = u0(x)
        v(x,0) = v0(x)
      
and boundary conditions at the left and right endpoints [A,B]:
        du/dx = 0
        dv/dx = 0
      
The Type II functional response employed here is
        h(eta) = eta / ( 1 + eta )
      
The parameters ALPHA, BETA, GAMMA and DELTA are strictly positive.

The user must input a value H specifying the desired space step to be used in discretizing the space dimension.

A finite difference scheme is employed to integrate the problem from time 0 to a maximum time T. The user must input the value T, as well as an appropriate time step DELT.

Typical data for this problem is:

        ALPHA =   0.3
        BETA  =   2.0
        GAMMA =   0.8
        DELTA =   1.0
        A     =   0.0
        B     = 200.0
        H     =   0.5
        T     =  40.0
        DELT  =   0.0104
        GAUSS =   0        (0 = direct solution, 1 = Jacobi )
      
with the initial values of U and V set, for instance, to:
        u0(1:n) = exp ( - ( x(1:n) - 100.0 )**2 ) / 5.0
        v0(1:n) = 2.0 / 5.0
      

Licensing:

The computer code and data files described and made available on this web page are distributed under the MIT license

Languages:

fd1d_predator_prey is available in a Fortran90 version and a MATLAB version and an Octave version.

Related Data and Programs:

fd1d_predator_prey_test

fd1d_burgers_lax, a Fortran77 program which applies the finite difference method and the Lax-Wendroff method to solve the non-viscous time-dependent Burgers equation in one spatial dimension.

FD1D_BURGERS_LEAP, a Fortran77 program which applies the finite difference method and the leapfrog approach to solve the non-viscous time-dependent Burgers equation in one spatial dimension.

FD1D_BVP, a Fortran77 program which applies the finite difference method to a two point boundary value problem in one spatial dimension.

FD1D_HEAT_EXPLICIT, a Fortran77 program which uses the finite difference method and explicit time stepping to solve the time dependent heat equation in 1D.

FD1D_HEAT_IMPLICIT, a Fortran77 program which uses the finite difference method and implicit time stepping to solve the time dependent heat equation in 1D.

FD1D_HEAT_STEADY, a Fortran77 program which uses the finite difference method to solve the steady (time independent) heat equation in 1D.

FD1D_PREDATOR_PREY_PLOT, a MATLAB program which displays the solution components computed by FD1D.

FD1D_WAVE, a Fortran77 program which applies the finite difference method to solve the time-dependent wave equation utt = c * uxx in one spatial dimension.

FD2D_PREDATOR_PREY, a Fortran90 program which implements a finite difference algorithm for a predator-prey system with spatial variation in 2D.

FEM1D, a Fortran90 program which applies the finite element method, with piecewise linear basis functions, to a two point boundary value problem;

Reference:

  1. Marcus Garvie,
    Finite-Difference Schemes for Reaction-Diffusion Equations Modeling Predator-Prey Interactions in MATLAB,
    Bulletin of Mathematical Biology,
    Volume 69, Number 3, 2007, pages 931-956.

Source Code:


Last revised on 06 December 2023.