Numeric Solution of Advection-Diffusion Equations by a Discrete Time Random Walk Scheme
Abstract
Explicit numerical finite difference schemes for partial differential equations are well known to be easy to implement but they are particularly problematic for solving equations whose solutions admit shocks, blowups and discontinuities. Here we present an explicit numerical scheme for solving non-linear advection-diffusion equations admitting shock solutions that is both easy to implement and stable. The numerical scheme is obtained by considering the continuum limit of a discrete time and space stochastic process for non-linear advection-diffusion. The stochastic process is well posed and this guarantees the stability of the scheme. Several examples are provided to highlight the importance of the formulation of the stochastic process in obtaining a stable and accurate numerical scheme.
1 Introduction
This work considers a general form of nonlinear dissipative dominated partial differential equations and more closely examines the numerical solutions of the Burgers’ equation which is a limiting form of the more general dissipative system, as derived by Su and Gardner [1]. The Burgers’ equation admits some difficulties in obtaining numerical solutions under sufficiently high Reynolds numbers wherein shocks in the solution may form. Many authors have obtained numerical solutions to the Burgers’ equation using finite elements, finite differences, exponentially fitted methods, spectral methods, cubic B-splines, Adomian decomposition methods, differential quadrature, wavelets, compact schemes and method of lines [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].
Recently Klein and Saut [13] introduce a novel approach to the Burgers’ equation as well as the fractional Korteweg-de Vries equations. Angstmann et al. [14, 15, 16, 17] provide a framework for the construction of fractional and integer order reaction-diffusion models which is able to recover a general class of parabolic-hyperbolic equations. This framework is based on the random walk principles. In [17] Angstmann et al. illustrate how the discrete time random walk is able to numerically solve equations of this class.
Thomée [18] provides an extensive review of finite difference and finite element analysis for partial differential equations. This work covers the concepts of convergence and stability for numerical methods for partial differential equations as well as the importance of the Courant, Freidrichs and Lewy (CFL) condition for numerical solutions to advective equations.
Exact solutions to the Burgers’ equation have been sought through the well known Hopf-Cole [19, 20] transformation, which recovers the standard heat equation from the Burgers’ equations. Fletcher [21] generates exact solutions for the two-dimensional Burgers’ equation through the multi-dimensional interpretation of the Hopf-Cole transformation.
This work derives a master equation from a discrete time and space stochastic process as a numerical scheme to approximate a partial differential equation. The correspondence between the discrete master equation and the partial differential equation is established by taking the diffusion limit of the discrete stochastic process.
We first construct the master equation that will govern the evolution of the probability mass function of the random walking particle. We then show that, under the appropriate limit, this master equation will approach an advection diffusion equation. This shows that the master equation can function as an approximation of the advection diffusion equation. Further more, as the limit process of the random walk exists under the same limit, the solution of the difference equation will converge towards the solution of the advection diffusion equation. This allows us to construct a numerical scheme for the advection diffusion equation.
Appropriate construction of the jump probabilities of the random walk guarantees that the stochastic process remains well defined for any given lattice spacing. Similar constructions are also used on the boundary conditions to again guarantee that the random walk remains valid for all lattice spacings.
A rigorous numerical analysis of the present method is conducted as a means of verifying the results and illustrating the efficacy of the method.
2 A Discrete Time Random Walk
2.1 Master Equation
We consider a discrete time random walk on a one dimensional lattice. A particle begins at an initial position and at each time step the particle will jump from its current lattice site to a neighbouring lattice site. The probability that a particle on the lattice site will jump to the right on the time step is given by an arbitrary time and space dependent probability, , and the probability of jumping to the left is given by the complement, . We can recursively define the probability of the particle being at lattice site at time step , denoted , given some initial condition, ,
(1) |
This is the master equation governing the time evolution of the probability mass function for the process. Here we have considered an infinite lattice, later we will discuss a finite lattice, in which boundary conditions are defined for a boundary set at at all times .
2.2 Diffusion Limit
We wish to consider the continuum space and time limit of the discrete time random walk. The appropriate limit in this case is a diffusion limit in which the space and time scales are together taken to zero with the requirement that the following limit exists,
(2) |
where is the spatial grid spacing and is the temporal grid spacing [22]. In the diffusion limit the master equation, Eq. (1), will become an advection-diffusion PDE. As such, the master equation itself may be considered as an approximation to the advection-diffusion equation.
First we begin by associating each of the discrete functions, with a continuous function,, such that,
(3) |
This association is dependent on the lattice spacings, and . The jump probabilities may also be associated with continuum functions, sampled at discrete points,
(4) |
and similarly for . At each point the continuum jump probabilities sum to one,
(5) |
At the point and ,the discrete master equation, Eq. (1) then becomes,
(6) |
Defining a force function,
(7) | ||||
(8) |
the master equation can be expressed as,
(9) |
Further manipulations give,
(10) |
We are now set up to take the diffusion limit, that is the limit and such that the limit, Eq. (2) exists. This limit will take the random walk stochastic process to a limit process provided that the limit process exists. In this case the limit process will exist as the original stochastic process is a simple random walk [23]. The particle distribution from the limit process will be given by the limit of the continuum embedding of the discrete process distribution, i.e.,
(11) |
Taking the limit of Eq. (LABEL:eq_nonlim) gives,
(12) |
where,
(13) |
This shows that the diffusion limit of the random walk master equation is an advection-diffusion PDE. It should be noted that there is no condition on the form of the force function and this PDE may be a non-linear advection-diffusion equation by considering as an explicit function of .
3 Formulation of the Numerical Scheme
Given a general non-linear advection diffusion PDE of the form
(14) |
we can form a numerical scheme by matching the diffusion limit of the master equation to the PDE. The diffusion limit of the master equation is completely defined by two parameters, , and , as well as a single function , and hence we need a method of obtaining these parameters from the PDE. Firstly, fixing the spatial lattice spacing will also fix the temporal step size through the relation,
(15) |
Next, we have a condition on the function that is imposed by matching the PDE to the diffusion limit of the master equation. Given a and we have and in the diffusion limit we require,
(16) |
Whilst any choice of function, , that obeys this limit will work it is desirable to chose a function that will provide a stable numerical scheme far from the limit. In order for the master equation to describe a valid stochastic process the jump probability must always lie between and , i.e. . The most obvious form from the limit relation, Eq. (16), would be to take,
(17) |
This is a poor choice as the restriction , puts an upper bound on . To overcome this limitation we construct the jump probability from Boltzmann weights [24]. These weights are taken by considering a diffusing particle at equilibrium in a potential where,
(18) |
The position of such a particle will follow a Boltzmann distribution such that the probability of finding the particle at position at time will be proportional to , where is related to the “temperature” of the system. If we restrict this distribution such that the particle may only be present at or then the normalisation constant is simply . Given that the particle begins at , we interpret the probability that the particle has jumped right from is the Boltzmann probability of the particle being at . Similarly we interpret the probability that the particle has jumped left from as the Boltzmann probability of the particle being at .We can then write,
(19) |
Such a functional form will obey the limit condition, Eq. (16), as well as guarantee that for all and . Using this jump probability the master equation can be written with an arbitrary and remain a valid stochastic process.
The Boltzmann weights are defined in terms of a potential . In order to implement the numerical scheme we need to rework this into a function of the force . From Eq. (18) we can write,
(20) |
The Boltzmann weights call for the potential evaluated at and , these can be written relative to the potential at ,
(21) |
and similarly,
(22) |
If is a simple function of space and time then this integral may be solved analytically and the results used in the jump probabilities. A complication arrises when the force is dependent on the particle distribution itself, i.e. a non linear force . While the above integral is conceptually fine, we will only have an approximation to the probability distribution on the lattice points. In computing the integral we will need to use a numerical quadrature that is restricted to these lattice points. There are two convenient approximations that can be used, either a single point or a two point quadrature. The single point quadrature is,
(23) | |||
(24) |
Substituting the resulting approximations for the potential into the Boltzmann weights, Eq. (19), and simplifying gives,
(25) |
or more compactly,
(26) |
The single point quadrature results in jump probabilities that only require the force to be evaluated at a single lattice point.
The two point quadrature is,
(27) | |||
(28) |
Substituting the resulting approximations for the potential into the Boltzmann weights, Eq. (19), and simplifying gives,
(29) |
or more compactly,
(30) |
To evaluate the jump probabilities using the two point quadrature requires evaluating the force at three lattice points.
The final discrete time random walk numerical scheme for a non-linear advection diffusion equation can then be found by substituting these weights into the master equation. The two point quadrature jump probabilities give,
(31) |
Using the two point quadrature jump probabilities results in a method that requires knowledge of the function at five lattice points. Using the single point quadrature results in a method that only requires three points.
In this formulation we have a single free scale parameter, which may be cast as either or . Every other parameter or function comes from the PDE that we wish to approximate.
3.1 Initial Conditions
The scheme has been derived from the evolution of a probability density function. In general the integral of the initial condition over the domain will not equal one, and hence cannot be a probability density. As such we note that it is always possible to rescale any initial condition and we can consider the evolution equation to evolve a general non-normalised distribution. Another consequence of the distributional nature of the derivation is that we have a guarantee that the solutions will conserve mass, provided that the boundary conditions preserve mass, and be bound non-negative. Whilst this is often advantageous, a further complication arises if the initial condition is not strictly non-negative. This can not be interpreted as a distribution and hence may not be evolved forward by the master equation. However it is possible to write any generalised function as the difference between two distributions. We simply define two strictly non-negative distributions and such that,
(32) |
If the strictly non-negative distributions evolve according to the coupled non-linear advection diffusion equations,
(33) | ||||
(34) |
then will evolve according to the non-linear advection diffusion equation,
(35) |
Note that the coupling occurs through the non-linear force term. The evolution of the distributions and may be approximated as coupled DTRWs. The resulting numerical scheme is,
(36) | ||||
(37) | ||||
where . Notice that if we take the difference of Eq. (36) and Eq. (37) then we recover the original numerical scheme, Eq. (31) with no appearance of or . Thus we can use the original numerical scheme for the case of initial conditions with mixed sign, provided that the boundary conditions also do not contain or .
3.2 Boundary Conditions
Care must be taken with the implementation of boundary conditions so that the underlying random walk remains valid. The boundary conditions thus need to be consistent with both the underlying stochastic process and the given PDE boundary conditions. In general, this excludes some conditions, but does still allow for the implementation of a wide variety. The scheme can accommodate non-conservative boundary conditions, but care needs to be taken that the boundaries do not force a positive distribution to become negative.
3.2.1 Dirichlet Boundary Conditions
In the case of a strictly non-negative initial condition, Dirichlet boundary conditions are also restricted to be non-negative. The conditions are implemented by fixing the value at the boundary. Using the two point quadrature, the jump probabilities are dependent on the solution at neighbouring points. As the jump probabilities need to be evaluated at the boundary point an additional point is required to use the two point quadrature form of the jump probabilities at the boundary. If an additional point is not known then the single point quadrature is required to be used.
Given the boundary condition at ,
(38) |
where , we set
(39) |
where .
In the case that the initial condition is of mixed sign, then the Dirichlet boundary condition must be compatible with the extension given in Section 3.1. Again breaking the solution into two non-negative distributions, , the boundary condition needs to be formulated for both non-negative distributions. Given a boundary condition at of the form,
(40) |
we will require,
(41) |
Given that we also require and , this is most easily satisfied by,
(42) |
and
(43) |
The boundary conditions are then implemented by setting,
(44) |
and
(45) |
where .
3.2.2 Neumann Boundary Conditions
The restriction on Neumann boundary conditions are more subtle. We will consider here the case of a non-negative initial condition, although the results are again simply extended using the approach in Section 3.1. In the same manner as the standard finite difference schemes, the boundary condition may be implemented by including a ghost point outside the domain. Given a Neumann boundary condition at of the form,
(46) |
where , and where the domain sits to the left of , we may set the ghost point via standard finite difference approximations,
(47) |
where . This will result in the correct behaviour of the numerical scheme as , but may not be consistent with the stochastic process. If is sufficiently large, depending on the exact form of , it would be possible for the value at the ghost points to become negative. An alternative is to construct the ghost points by scaling the boundary points. In order for the boundary condition to hold we require,
(48) |
where . This limit relationship will be obeyed by the standard finite difference approximations, but there are many other choices that could be made. In keeping with the Boltzmann weights construction we may take,
(49) |
These results are easily extendable for considering a left-boundary point, where the domain sits to it’s right. This choice guarantees that the ghost points remain positive and hence that they remain consistent with the stochastic process. Once again the single point quadrature form of the jump probabilities needs to be used at the ghost point.
4 Numerical Analysis
4.1 Stability
If the distance between the approximation from the numerical scheme and the solution to the PDE is bounded for all time steps then the numerical scheme is said to be stable. To show that the scheme is stable it is then sufficient to show that, using the -norm,
(50) |
for all where . It is trivial to see that,
(51) |
From this, provided that the exact solution, , is bounded, the stability of the numerical method is assured if the approximation remains bounded.
As is derived from an underlying stochastic process and as such is a density we know that and hence,
(52) |
In general stability needs to be shown individually for the problem under consideration. However there are two general classes of problems where we can show unconditional stability. The first class we can consider is a periodic domain with a commensurate periodic potential. In such a case the boundary points are set to the interior point at the opposite boundary. Considering the case of the domain and taking a lattice of points with boundary points at and , then
(53) |
The periodic boundary conditions then imply that , and . The periodic potential ensures that the jump probabilities follow the same relation, , and . Thus the total mass is conserved as from Eq. (53). As the initial mass is finite the conservation of mass guarantees the stability of the scheme.
The next class of unconditionally stable problems is the case of zero-flux boundary conditions. Here we have the condition that no mass is entering the system at the boundary. For this to be true the continuum equations must satisfy the following conditions,
(54) |
and
(55) |
Considering the case of the domain and taking lattice of points the boundary conditions are enforced by setting ghost points at and , then
(56) |
Zero-flux boundary conditions are implemented by setting the ghost points such that the total mass will be conserved,
(57) | ||||
(58) |
Using the two point quadrature Boltzmann weights, Eq. (30) and taking the limit , Eq. (57) recovers Eq. (54) as required. Again as the total mass is conserved the numerical scheme will be stable.
4.2 Accuracy
In order to estimate the accuracy of the DTRW numerical scheme we consider the scheme as if it were derived from a Taylor series. Considering a non-linear advection diffusion equation of the form,
(59) |
The numerical scheme that approximates this equation is then,
(60) |
where, as before, the jump probabilities are given by Boltzmann weights,
(61) |
and
(62) |
Taking the Taylor expansion with respect to , of the terms on the right hand side of Eq. (60), around , to order we have
(63) |
and
(64) |
Substituting equations (63) and (64) into equation (60), dividing through by and collecting term appropriately we obtain,
(65) |
Taking the Taylor expansion of the left hand side with respect to we have,
(66) |
with this reduces to,
(67) |
Finally noting that we see that the scheme will be convergent with order .
5 Burgers’ Equation
To show the utility of the numerical scheme we consider the viscous Burgers equation,
(68) |
The Burgers’ equation may be transformed into the heat equation by using the Hopf-Cole transformation [19, 20],
(69) |
This transforms Burgers equation into the standard diffusion equation,
(70) |
This allows for the construction of an infinite domain solution to the Burgers equation. One such solution is.
(71) |
where are constants that depend on the initial condition. If we take the initial condition to be,
(72) |
Then the solution is given by,
(73) |
To construct the numerical scheme we match the PDE of interest, Eq (68), to the diffusive limit of the master equation, Eq. (14). From this we see that,
(74) | ||||
(75) | ||||
(76) |
Thus the numerical scheme, Eq. (31), becomes,
(77) |
5.1 CFL Condition
The Courant-Friedrichs-Lewy (CFL) condition is a well known necessary criterion for the stability of finite difference type numerical schemes for hyperbolic partial differential equations. The CFL condition can be understood to imply that the numerical domain of the solution must be able to support the analytic solution of the PDE, otherwise information will be lost as the numerical solution is propagated in time [25]. For the Burgers’ equation under consideration CFL condition states that
(78) |
where is the magnitude of velocity and is usually 1. We note here that the maximum velocity that our grid can accurately capture is and the maximum advective velocity prescribed by the model is . We then require
(79) |
which is equivalent to the CFL condition in this case. Moreover, the relation
(80) |
indicates the relation between mesh spacing and the diffusive coefficient , i.e. we have
(81) |
Unfortunately to impose this condition the solution, , needs to be known or estimated for all time and space. However, we may derive a useful heuristic from a physical argument: since the CFL condition ensures that the granularity of the mesh is sufficiently fine to accurately capture the velocity of propagation we may also interpret this as requiring the probability of jumping left or right to be within , where a probability of jumping left (or right) of 1 (or 0) implies that a particle is moving at the maximum velocity allowed by the mesh, and within this framework this velocity may never be exceeded. We may then heuristically check that the jump probabilities remain sufficiently far from either 0 or 1.
We also argue that due to the viscosity present in the model, the maximum value of occurs when for some value of . We may then prescribe the CFL number to be .
We note here that, in general, violation of the CFL condition does not guarantee that a numerical solution will blow up. We observe numerically that if the CFL condition is violated erroneous features form in the solution but the stability of the scheme, in respect to Eq. (50) is not compromised.
5.2 Example 1: Dirichlet Boundary Conditions
The infinite domain solution, Eq (73), may be used to find an exact solution of the Burger’s equation on a finite domain, subject to time dependent Dirichlet boundary conditions. Taking Eq. (68) on the domain with the initial condition given by Eq. (72), and boundary conditions,
(82) | ||||
(83) |
The exact solution is then given by Eq. (73).
The numerical scheme then comprises of Eq. (77), subject to the initial conditions,
(84) |
The Dirichlet boundary conditions are implemented via Eq. (39), this requires the setting of the boundary points,
(85) | ||||
(86) |
where is . The jump probabilities for the boundary points must be computed using the single point quadrature form, Eq. (26), so as to avoid the need for an additional point exterior to the boundary. Thus,
(87) |
and
(88) |
For , will be given by Eq. (77).
A numerical solution was obtained where , and . A range of values were chosen so that the numerical method would produce a value at , specifically . Confirming the accuracy analysis in section 4.2 an accuracy of order was observed. Figure 1 provides a plot of the L1-Norm of the error defined as,
(89) |

5.3 Example 2: Neumann Boundary Conditions
The second example we consider uses Neumann boundary conditions, again obtaining an exact solution from the infinite domain solution. Considering the Burger’s equation, Eq. (68), on the domain, with the initial condition given by Eq. (72), and with time dependent Neumann boundary conditions given by,
(90) | ||||
(91) |
Then the solution will once again be given by Eq. (73). In this case we need the boundary points, and , to lie between lattice points. As such we have,
(92) |
Similarly to Example 1, the numerical scheme comprises of Eq. (77), subject to the initial conditions,
(93) |
The boundary conditions are now implemented by setting ghost points outside the domain via Eq. (49), so that,
(94) |
and
(95) |
Once again, the jump probabilities for the ghost points must be computed using the single point quadrature form, Eqs. (25) and (26), so as to avoid the need for an additional ghost point.
Similarly to example one, values of were chosen so that the solution could be compared at , specifically . As in example one, an accuracy of order was observed.

6 Conclusion
We have shown that a discrete time random walk (DTRW) can be used to construct a numerical method for the solution of general non-linear advection-diffusion partial differential equations. The derived explicit numerical scheme is both easy to implement and stable, even in the case where the underlying equations admit shock solutions. Provided that the underlying stochastic process that the numerical scheme is based on exists, we have shown that the scheme must be stable. As a prototypical example of a nonlinear advection-diffusion equation we have considered the one-dimensional viscous Burgers’ equation. Burgers’ equation arises from the simplification of the homogenous incompressible Navier-Stokes equations and has been extensively used as a benchmark for numerical methods for hyperbolic partial differential equations due to the non-linearities and array of dynamics exhibited by the equation. The presented DTRW scheme accurately captures the dynamics of Burgers’ equation when compared with exact solutions.
Acknowledgments
This work was supported by the Australian Commonwealth Government (ARC DP140101193). B.A.J. acknowledges the National Research Foundation of South Africa under grant number 94005. Opinions expressed and conclusions arrived at are those of the author and are not necessarily to be attributed to the CoE-MaSS.
References
- [1] C. Su, C. Gardner, Korteweg-de Vries equation and generalizations. III. Derivation of the Korteweg-de Vries equation and Burgers equation, J. Math. Phys. 10 (3) (1969) 536–539.
- [2] J. Caldwell, P. Smith, Solution of Burgers’ equation with a large Reynolds number, Appl. Math. Model. 6 (5) (1982) 381–385.
- [3] S. Kutluay, A. Bahadir, A. Özdeş, Numerical solution of one-dimensional Burgers equation: explicit and exact-explicit finite difference methods, J. Comput. Appl. Math. 103 (2) (1999) 251–261.
- [4] Y. Hon, X. Mao, An efficient numerical scheme for Burgers’ equation, Appl. Math. Comput. 95 (1) (1998) 37–50.
- [5] T. Öziş, U. Erdoğkan, An exponentially fitted method for solving Burgers’ equation, Int. J. Numer. Meth. Eng. 79 (6) (2009) 696–705.
- [6] R. Mittal, P. Singhal, Numerical solution of periodic Burgers equation, Indian J. Pure Ap. Math. 27 (7) (1996) 689–700.
- [7] I. Dağ, D. Irk, B. Saka, A numerical solution of the Burgers’ equation using cubic B-splines, Appl. Math. Comput. 163 (1) (2005) 199–211.
- [8] S. Abbasbandy, M. Darvishi, A numerical solution of Burgers’ equation by modified Adomian method, Appl. Math. Comput. 163 (3) (2005) 1265–1272.
- [9] R. Bellman, B. Kashef, J. Casti, Differential quadrature: a technique for the rapid solution of nonlinear partial differential equations, J. Comput. Phys. 10 (1) (1972) 40–52.
- [10] G. Beylkin, J. M. Keiser, On the adaptive numerical solution of nonlinear partial differential equations in wavelet bases, J. Comput. Phys. 132 (2) (1997) 233–259.
- [11] H. Bhatt, A. Khaliq, Fourth-order compact schemes for the numerical simulation of coupled Burgers’ equation, Comput. Phys. Commun. 200 (2016) 117–138.
- [12] V. Mukundan, A. Awasthi, Efficient numerical techniques for Burgers’ equation, Appl. Math. Comput. 262 (2015) 282–297.
- [13] C. Klein, J.-C. Saut, A numerical approach to blow-up issues for dispersive perturbations of Burgers’ equation, Physica D 295 (2015) 46–65.
- [14] C. N. Angstmann, I. C. Donnelly, B. I. Henry, Continuous time random walks with reactions, forcing, and trapping, Math. Model. Nat. Phenom. 8 (2) (2013) 17–27.
- [15] C. N. Angstmann, I. C. Donnelly, B. I. Henry, J. A. Nichols, A discrete time random walk model for anomalous diffusion, J. Comp. Phys. 293 (0) (2014) 53–69.
- [16] C. Angstmann, I. Donnelly, B. Henry, T. Langlands, P. Straka, Generalized continuous time random walks, master equations, and fractional fokker–planck equations, SIAM J. Appl. Math. 75 (4) (2015) 1445–1468.
- [17] C. Angstmann, I. Donnelly, B. Henry, B. Jacobs, T. Langlands, J. Nichols, From stochastic processes to numerical methods: A new scheme for solving reaction subdiffusion fractional partial differential equations, J. Comput. Phys. 307 (2016) 508–534.
- [18] V. Thomée, From finite differences to finite elements: A short history of numerical analysis of partial differential equations, J. Comput. Appl. Math. 128 (1) (2001) 1–54.
- [19] E. Hopf, The partial differential equation , Comm. Pure Appl. Math. 3 (3) (1950) 201–230.
- [20] J. D. Cole, On a quasi-linear parabolic equation occurring in aerodynamics, Quart. Appl. Math. 9 (1951) 225–236.
- [21] C. A. Fletcher, Generating exact solutions of the two-dimensional Burgers’ equations, Int. J. Numer. Meth. Fl. 3 (3) (1983) 213–216.
- [22] M. Kac, Random walk and the theory of brownian motion, Am. Math. Monthly. 54 (7) (1947) 369–391.
- [23] G. Gill, P. Straka, A semi-markov algorithm for continuous time random walk limit distributions, Mathematical Modelling of Natural Phenomena 11 (3) (2016) 34–50.
- [24] B. I. Henry, T. A. M. Langlands, P. Straka, Fractional Fokker-Planck equations for subdiffusion with space- and time-dependent forces, Phys. Rev. Lett. 105 (17) (2010) 170602.
- [25] C. B. Laney, Computational gasdynamics, Cambridge University Press, 1998.