Implementation of high-order,
discontinuous Galerkin time stepping
for fractional diffusion problems
Abstract
The discontinuous Galerkin (dG) method provides a robust and flexible technique for the time integration of fractional diffusion problems. However, a practical implementation uses coefficients defined by integrals that are not easily evaluated. We describe specialised quadrature techniques that efficiently maintain the overall accuracy of the dG method. In addition, we observe in numerical experiments that known superconvergence properties of dG time stepping for classical diffusion problems carry over in a modified form to the fractional-order setting.
1 Introduction
The discontinuous Galerkin (dG) method provides an effective numerical procedure for the time integration of diffusion problems. In the mid-1980s, Eriksson, Johnson and Thomée [2] provided the first detailed error analysis, which has been subsequently extended and refined by numerous authors [[]and references therein]MakridakisNochetto2006,SchmutzWihler2019,SchotzauSchwab2001. The dG method has also proved effective for time stepping of fractional diffusion problems [9, 12] of the form
(1) |
Here, is a linear, second-order, elliptic partial differential operator over a spatial domain , subject to a homogeneous Dirichlet boundary condition on . (Our notation suppresses the dependence of and on the spatial variables.) The fractional diffusion exponent is assumed to satisfy (the sub-diffusive case), and the fractional time derivative is understood in the Riemann–Liouville sense: for and ,
The partial integro-differential equation (1) arises in a variety of physical models [3, 11] of diffusing particles whose behaviour is described by a continuous-time random walk for which the waiting-time distribution is a power law that decays like . The expected waiting time is therefore infinite, and the mean-square displacement is proportional to . Standard Brownian motion is recovered in the limit as , when (1) reduces to the classical diffusion equation.
Our main concern in the present work is with the practical implementation of dG time stepping for (1), and in particular with the accurate evaluation of certain coefficients used during the th step. Section 2 introduces the dG method for the fractional ODE case of (1), in which the operator is replaced by a scalar . We will see in the simplest, lowest-order scheme, when the dG solution is piecewise-constant in time, that
and
where are the discrete time levels. We easily verify that , for a step-size , and
(2) | ||||
but for higher-order schemes the coefficients become progressively more complicated. Although the can always be evaluated via repeated integration by parts, the resulting expressions are likely to suffer from roundoff when evaluated in floating-point arithmetic if is large. Consider just the lowest order case (2) with uniform time steps , so that
Since the factor in square brackets is a second-difference of , its magnitude decays like as increases, but the individual terms grow like .
We are therefore led to evaluate the coefficients via quadratures with positive weights. No special techniques are needed for , but when or we must deal with weakly singular integrands. In Section 3, we show how certain substitutions reduce the problem to dealing with integrands that are either smooth, or are products of smooth functions and standard Jacobi weight functions. Similar substitutions, known as Duffy transformations [1], have long been used to compute singular integrals arising in the boundary element method.
Section 4 introduces a spatial discretisation for the fractional PDE (1) and describes the structure of the linear system that must be solved at each time step. In Section 5, we specialise the expressions for the coefficients by choosing Legendre polynomials as the shape functions employed in the dG time stepping.
Section 6 describes a post-processing technique that, when applied to the dG solution , produces a more accurate approximate solution , known as the reconstruction [6] of . If is a piecewise polynomial of degree at most , then is a piecewise polynomial of degree at most . For a classical diffusion problem, both and are known to be quasi-optimal, that is, accurate of order and , respectively. Thus, it is natural to ask what happens in the fractional-order case, and we investigate this question in numerical experiments reported in Section 7.
2 A fractional ODE
Our central concern is present already in the zero-dimensional case when we replace the elliptic operator with a scalar , so that the solution is a real-valued function satisfying the fractional ODE
(3) |
For the time discretisation, we introduce a grid
and form the vector . Let denote the length of the th (open) subinterval . We form the disjoint union
and for any function write
provided the one-sided limits exist.
Given a vector of integers , the trial space consists of the functions such that for . Here, denotes the space of polynomials of degree at most , with real coefficients. The dG solution of (3) is then defined by [9, 12]
(4) |
for and , where, in the case , we set so that . (The monograph of Thomée [15, Chapter 12] is a standard reference providing a general introduction to dG time stepping for classical diffusion problems.)
To compute , we choose for each a basis , , …, for and write
(5) |
When , we find that
with coefficients given by
and
Owing to the convolutional structure of the fractional derivative, it is convenient to introduce the notation
and define, if ,
with
We find that
and thus
Hence, putting
the dG method (4) requires
(6) |
At the th time step, this linear system must be solved to determine , ,…, and hence for .
Remark 1.
If we send , so that the fractional ODE in (3) reduces to the classical ODE , then for . Indeed, since , we see that is constant and so for . Moreover, so .
Remark 2.
Later we will show certain symmetry properties of using the identity
(7) |
In fact, the substitution gives
and (7) follows after reversing the order of integration and then integrating by parts. Similarly, for ,
(8) |
3 Evaluation of the coefficients
To compute , and it is convenient to map each closed subinterval to the reference element . We therefore define the affine function by
and let
In this way,
(9) |
and
(10) |
Both of these coefficients are readily computed; the remainder of this section is devoted to . The formulae in the next lemma allow us to compute to machine precision via Gauss–Legendre and Gauss–Jacobi quadrature.
Lemma 3.
If we define the polynomial
then
Proof:
Since , integration by parts gives
and since , the substitution yields
Thus,
where
We make the substitution , which results in a fixed singularity at , and then reverse the order of integration:
The substitution then yields
implying the desired formula for .
To deal with for , we introduce the notation
with
so that
Lemma 4.
If , then
where
Proof:
Integrating by parts, we find that
The substitution gives
and the formula for follows at once.
Notice that
so the integrand of is always smooth. However,
so the integrands of and are weakly singular if (i.e., if ). The next lemma provides alternative expressions that are amenable to Gauss–Jacobi and Gauss–Legendre quadrature.
Lemma 5.
Let . Then,
and
Proof:
Since , the formula for follows at once. To deal with we begin by mapping onto with the substitution . In this way, the singularity at moves to , and
with
By splitting the integration domain into the triangular halves where and , we obtain
The substitution tranforms the inner integral in the first term to
and the substitution transforms that in the second to
Thus,
Now make the substitutions and .
We also have the following alternative representation.
Lemma 6.
If , then
Proof:
When ,
and so
(11) |
The result now follows via the substitutions and , noting that .
Remark 7.
If the time levels are uniformly spaced, and if the reference basis functions are the same for each subinterval, say
then
so the formulae of Lemma 4 show that depends on and only through the difference ; for further details, see Example 12 below.
4 Spatial discretisation
The initial-boundary value problem (1) is known to be well-posed [5, 8, 10]. Let denote the usual inner product in , and let denote the bilinear form associated with via the first Green identity. For example, if then . In this way, the weak solution satisfies
We choose a finite dimensional subspace for , and form the vector . For example, might be a (conforming) finite element space constructed using a triangulation of . Our trial space then consists of the functions such that , that is, the restriction is a polynomial in of degree at most , with coefficients from . Generalising (4), the dG solution of (1) satisfies
(12) |
for and , with for a suitable such that .
We choose a basis for . In the expansion (5), the coefficient is now a function in , so there exist real numbers such that
for example, if is the th free node of a finite element mesh and if is the corresponding nodal basis function. Similarly, for the discrete initial data, there are real numbers such that
5 Legendre polynomials
Let , , , …denote the Legendre polynomials with the standard normalisation for all . By choosing
(16) |
we obtain a convenient and well-conditioned basis for with the properties
for , .
Lemma 8.
Proof:
The properties (17) follow from and . Hence, the formula for follows from (10), and by (9),
If , then because is orthogonal to . Otherwise, if , then is orthogonal to so integration by parts gives
and hence .
Example 9.
If and , then the matrices and are
We have no analogous, simple formula for the remaining coefficients . However, when () the following parity property holds.
Lemma 10.
With the choice (16) of basis functions,
(18) |
Proof:
Using (7), we find that
where
Let . A short calculation shows that , so
and therefore, using the substitution ,
as claimed.
Remark 11.
In the limit as , we see from Remark 1 that
Example 12.
Consider the uniform case , and for (as in Remark 7), with as above. We then have
where, by Lemma 3,
(19) | ||||
with
(20) |
and by Lemma 4,
with, letting ,
Moreover, Lemma 5 provides alternative expressions when :
and
Likewise, Lemma 6 provides an alternative expression for :
(21) |
Finally, by arguing as in the proof of Lemma 10, we can show that
(22) |
6 Reconstruction
Throughout this section, we continue to use the Legendre basis (16). Some insight into the dG method can be had by considering the trivial case of (1) when , that is, for , with . The dG scheme (12) then reduces to
(23) |
for and , with . To state our next result, let denote the orthoprojector from onto , and define
Lemma 13.
If and , then for the dG solution satisfies
(24) |
and
(25) |
Proof:
Integrating by parts in (23), we find that
Given , by choosing the constant function for we deduce that and so (25) is satisfied. Moreover,
and, by the choice of initial condition, we see that (24) is satisfied for :
Letting , we make the induction hypothesis
and observe that
which gives the desired formula (24).
For the remainder of this section, we will assume that the subspaces are nested, as follows:
(26) |
It follows that for and so
(27) |
The following explicit representation for holds.
Lemma 14.
If , and the subspaces satisfy (26), then
(28) |
where
are the local Fourier–Legendre coefficients of , but
Proof:
By definition, so there exist coefficients and in such that has the desired expansion. The formula for follows at once from the orthogonality property of the (see Remark 11). The formula for follows from (27) because for all .
We have a Peano kernel for the Fourier–Legendre expansion of degree ,
assuming is , and also a Peano kernel for the th coefficient:
Thus, if and , and if we define the local Peano kernels
then
(29) |
and
It follows that provided is on .
Theorem 15.
Assume that , and the subspaces satisfy (26). If is , then and
(30) |
Proof:
Corollary 16.
.
Proof:

In light of Theorem 15, we consider the polynomials
As illustrated in Figure 1, there are points
such that
In fact, the zeros , , …, are the points of a right-Radau quadrature rule [4, Chapter 9] on the interval . We put
(31) |
so that and
From Theorem 15, we see that for general , but for . Let denote the space obtained from by increasing the maximum allowed polynomial degree over the subinterval from to , for . The reconstruction of is then defined by requiring that
and that the one-sided limits at the end points are
Since is a polynomial of degree at most , it is uniquely determined by these interpolation conditions. Notice also that is continuous at if because .
Makridakis and Nochetto [6] introduced the reconstruction in their analysis of a posteriori error bounds for parabolic PDEs. Since the polynomial has degree at most and vanishes at for , it must be a multiple of . In fact, by taking limits as , we see that
(32) |
At the same time, by Theorem 15 and Corollary 16,
(33) |
implying that is on . One of our principal aims in the next section is to investigate numerically the error in the dG solution and its reconstruction in non-trival cases where . We can hope that something like (33) still holds, because the time derivative in the term is of lower order than in . Notice that (5) and (32) imply
where
7 Numerical experiments
A Julia package [7] provides functions to evaluate the coefficients , and based on the results of Sections 3 and 5. This package also includes (in the examples directory) the scripts used for the examples below.
7.1 The matrix
Let , and consider for simplicity the case when and are constant for all , so that the formulae of Example 12 apply. To get a sense of how the matrix entries behave, we computed
and
which illustrate the property (22). The factor in (21) becomes very smooth as increases, with the result that decays rapidly to zero as increases. Even for , we have
and Figure 2 shows this behaviour for larger values of , with entries in the lower right corner of the matrix reaching the order of the machine epsilon () once is of order .

The value of can be computed to machine precision using Gauss quadrature with and points for the integrals with respect to and in (19), and using points for the integral with respect to in (20). When , let denote the value of computed by applying -point Gauss rules to (21), that is, points for the double integral. For a given absolute tolerance , let denote the smallest for which
Table 1 lists some values of for . Unsurprisingly, fewer quadrature points are needed as increases.
1 | 9 | 9 | 5 | 3 | 2 |
---|---|---|---|---|---|
2 | 9 | 9 | 5 | 3 | 2 |
3 | 9 | 9 | 5 | 4 | 3 |
4 | 10 | 10 | 6 | 4 | 3 |
5 | 10 | 10 | 6 | 5 | 4 |
6 | 11 | 11 | 7 | 5 | 4 |

7.2 A fractional ODE
We consider the initial-value problem (3) in the case
(34) |
for which the solution is
where denotes the Mittag–Leffler function. The substitution yields a smooth integrand, allowing to be computed accurately via Gauss quadrature on the unit interval . Note that is just the scaled complementary error function.
Figure 3 shows , together with the dG solution using piecewise quadratics () and only subintervals. In Figure 4 we plot the absolute errors,
(35) |
again using piecewise quadratics but now with subintervals of uniform size . Two features are immediately apparent. First, the accuracy is poor near , reflecting the singular behaviour of the solution: for , the th derivative blows up like as . Second, on intervals away from , the error is notably smaller at the right-Radau points ( for ) than at the left endpoint ().

8 | 8.0e-03 | 8.8e-05 | 1.3e-04 | 1.0e-04 | ||||
---|---|---|---|---|---|---|---|---|
16 | 1.2e-03 | 2.69 | 1.4e-05 | 2.62 | 1.4e-05 | 3.15 | 9.3e-06 | 3.46 |
32 | 1.7e-04 | 2.87 | 1.5e-06 | 3.25 | 1.3e-06 | 3.40 | 8.2e-07 | 3.50 |
64 | 2.2e-05 | 2.94 | 1.4e-07 | 3.42 | 1.2e-07 | 3.47 | 7.2e-08 | 3.51 |
128 | 2.8e-06 | 2.97 | 1.3e-08 | 3.47 | 1.1e-08 | 3.49 | 6.3e-09 | 3.51 |
256 | 3.6e-07 | 2.98 | 1.1e-09 | 3.49 | 9.5e-10 | 3.50 | 5.5e-10 | 3.51 |
In Table 2, we show how the quantities
(36) |
behave as grows. These results, together with similar computations using other choices of and , lead us to conjecture that, in general, using a constant time step ,
whereas
and that, consequently,
However, using piecewise-constants () we do not observe any superconvergence, with both and behaving like , albeit with a noticably smaller constant in the case of .
To suppress the growth in the error as approaches , we can use a graded mesh of the form
(37) |
with a suitable grading exponent . Table 3 shows the maximum error in the reconstruction, i.e., , together with the associated convergence rates, for four choices of and using as the final time. These errors appear to be of order where . We conjecture that, in general,
(38) |
8 | 1.1e-02 | 1.4e-03 | 4.1e-04 | 7.1e-04 | ||||
---|---|---|---|---|---|---|---|---|
16 | 6.0e-03 | 0.84 | 3.8e-04 | 1.89 | 5.2e-05 | 2.95 | 9.1e-05 | 2.97 |
32 | 4.3e-03 | 0.50 | 1.3e-04 | 1.50 | 7.9e-06 | 2.72 | 1.0e-05 | 3.19 |
64 | 3.0e-03 | 0.50 | 4.7e-05 | 1.50 | 1.4e-06 | 2.51 | 9.8e-07 | 3.35 |
128 | 2.1e-03 | 0.50 | 1.7e-05 | 1.50 | 2.5e-07 | 2.50 | 9.2e-08 | 3.41 |
256 | 1.5e-03 | 0.50 | 5.9e-06 | 1.50 | 4.3e-08 | 2.50 | 8.4e-09 | 3.45 |
7.3 A fractional PDE
Consider the elliptic operator for the 1D spatial domain . To construct a reference solution, we exploit fact that the Laplace transform of ,
satisfies the two-point boundary-value problem
where
The variation-of-parameters formula leads to the integral representation
and the Laplace inversion formula then gives
(39) |
for a contour homotopic to the imaginary axis and passing to the right of all singularities of the integrand.



We choose as data the functions
(40) |
for constants and , and find that
where
and
To evaluate the contour integral (39) we apply an optimised equal-weight quadrature rule that arises after deforming into the left branch of an hyperbola [16]. Figure 5 shows the reference solution over the time interval in the case
(41) |
In Figure 6, we plot the -norms of the jumps, , together with the errors in and its reconstruction . The dG method used piecewise-quadratics (), first with a uniform mesh of subintervals (top), and then with a non-uniform mesh of subintervals (bottom). In both cases, the spatial discretisation used (continuous) piecewise cubics on a uniform grid with subintervals. Since is a quadratic polynomial in this instance, we simply put . Consistent with our conjecture (33), we observe that
Motivated by our conjecture (38), the second mesh was graded for by taking , and in the formula (37), followed by a uniform mesh on the other half of the time interval. We see that the mesh grading is effective at resolving the solution for near zero, albeit with a substantial increase in the overal computational cost.
Acknowledgements
This project was supported by a UNSW Faculty Research Grant (PS47152/IR001/MATH).
References
- [1] Michael G. Duffy “Quadrature over a pyramid or cube of integrands with a singularity at a vertex” In SIAM J. Numer. Anal. 19, 1982, pp. 1260–1262 DOI: 10.1137/0719090
- [2] Kenneth Eriksson, Claes Johnson and Vidar Thomée “Time discretization of parabolic problems by the discontinuous Galerkin method” In ESAIM: M2AN 19, 1985, pp. 611–643 DOI: 10.1051/m2an/1985190406111
- [3] J. Klafter and I. M. Sokolov “First Steps in Random Walks” Oxford University Press, 2011
- [4] Vladimir Ivanovich Krylov “Approximate Calculation of Integrals”, ACM Monographs New York: Macmillan, 1962
- [5] Kim-Ngan Le, William McLean and Martin Stynes “Existence, uniqueness and regularity of the solution of the time-fractional Fokker–Planck equation with general forcing” In Commun. Pure Appl. Anal. 18, 2019, pp. 2765–2787 DOI: 10.3934/cpaa.2019124
- [6] Charalambos Makridakis and Richardo H. Nochetto “A posteriori error analysis for higher order dissipative methods for evolution problems” In Numer. Math. 104, 2006, pp. 489–514 DOI: 10.1007/s00211-006-0013-6
- [7] William McLean “FractionalTimeDG: Generate coefficient arrays needed for discontinuous Galerkin time-stepping of fractional diffusion problems” Github, https://github.com/billmclean/FractionalTimeDG.jl, 2020
- [8] William McLean “Regularity of solutions to a time-fractional diffusion equation” In ANZIAM J. 52, 2010, pp. 123–138 DOI: 10.1017/S1446181111000617
- [9] William McLean and Kassem Mustapha “Convergence analysis of a discontinuous Galerkin method for a sub-diffusion equation” In Numer. Algor. 52, 2009, pp. 69–88 DOI: 10.1007/s11075-008-9258-8
- [10] William McLean, Kassem Mustapha, Raed Ali and Omar Knio “Well-posedness of time-fractional advection-diffusion-reaction equations” In Fract. Calc. Appl. Anal. 22, 2019, pp. 918–944 DOI: 10.1515/fca-2019-0050
- [11] Ralf Metzler and Joseph Klafter “The random walk’s guide to anomalous diffusion: a fractional dynamics approach” In Physics Reports 339, 2000, pp. 1–77 DOI: 10.1016/S0370-1573(00)00070-3
- [12] Kassem Mustapha “Time-stepping discontinuous Galerkin methods for fractional diffusion problems” In Numer. Math. 130, 2015, pp. 497–516 DOI: 10.1007/s00211-014-0669-2
- [13] Lars Schmutz and Thomas P. Wihler “The variable-order discontinuous Galerkin time stepping scheme for parabolic evolution problems is uniformly -stable” In SIAM J. Numer. Anal. 57, 2019, pp. 293–319 DOI: 10.1137/17M1158835
- [14] Dominik Schötzau and Christoph Schwab “Time discretization of parabolic problems by the hp-version of the discontinuous Galerkin finite element method” In SIAM J. Numer. Anal. 38, 2001, pp. 837–875 DOI: 10.1137/S0036142999352394
- [15] Vidar Thomée “Galerkin Finite Element Methods for Parabolic Problems” Springer, 2006
- [16] J. A. C. Weideman and L. N. Trefethen “Parabolic and hyperbolic contours for computing the Bromwich integral” In Math. Comp. 76, 2007, pp. 1341–1356 DOI: 10.1090/S0025-5718-07-01945-X