1. Introduction
In this paper, we consider numerical methods for the time-fractional diffusion equation with variable coefficients:
where
and
,
is the source term, and
is the Caputo derivative of order
with respect to
t, i.e.,
Here,
is the
function.
Fractional partial differential equations (FPDEs) have extensive applications in diverse fields, as illustrated in references [
1,
2,
3,
4,
5,
6,
7,
8]. Specifically, the time-fractional diffusion equation (TFDE) overcomes the limitations of traditional integer-order calculus. It offers a general mathematical framework for depicting complex systems exhibiting non-locality, long-range correlations, and memory effects. The time-fractional diffusion equation poses a significant challenge since it is an integro-differential equation, whose analytical solution is often difficult to derive. Consequently, numerical methods are necessary for its solution. Several approaches have been developed to solve the TFDE. For example, Ahmad et al. [
8] introduced Monte Carlo-based physics-informed neural networks with the cuckoo search (PINN-CS) algorithm for addressing fractional partial differential equations. Sun and Wu [
9] introduced and analyzed a finite difference scheme for the fractional diffusion wave equation. Lin and Xu [
10] proposed a numerical scheme using a finite difference scheme in time and Legendre spectral methods in space. Zhang and Sun [
11] presented an alternating direction implicit scheme. Sun et al. [
12] devised finite difference schemes for a variable-order time fractional diffusion equation. Yan, Pal, and Ford [
13] developed a
th-order method by directly discretizing the fractional differential operator. Li and Liao [
14] analyzed the well-known differential equations by applying the corresponding inverse operators.
Recently, research on numerical methods for Caputo fractional derivatives has increased significantly; see, e.g., [
15,
16,
17,
18,
19,
20,
21,
22,
23]. Gao et al. developed a novel difference analog of the Caputo fractional derivative, known as the L1-2 formula [
24]. Alikhanov used piecewise quadratic polynomial interpolation to derive the L2-1
formula for approximating the Caputo fractional derivative at specific points [
25]. The schemes proposed in [
17,
20,
23,
24,
25] have been proven to have
order accuracy for
th-order Caputo fractional derivatives. Notably, Quan and Wu [
23] established
-norm stability and convergence for an L2 scheme on general nonuniform meshes when applied to the subdiffusion equation. We noticed that the discrete form of these schemes at the first step
or the last step differs from the unified form for the rest of the steps. As an example, in [
20], the approximation of the first time step is obtained by using the L1-formula on the time layer
with step size
. To address this issue and preserve the order of convergence, we propose a scheme using piecewise quadratic polynomial interpolation, which computes approximate values in pairs. We call it the new L2 (NL2) discretization. We showed that the NL2 scheme’s discretization matrix is a block lower triangular Toeplitz matrix with two-by-two blocks and proved its
-norm stability and convergence. Numerical experiments show that the NL2 scheme has better accuracy than the L2 schemes proposed in [
17,
20].
The rest of this paper is organized as follows: In
Section 2, we propose a novel piecewise quadratic polynomial interpolation method, referred to as the new L2 scheme (NL2 for short), to approximate the Caputo fractional derivative. Subsequently, we derive the key properties of the NL2 scheme, including its consistency and the features of the discretization matrix.
Section 3 presents a difference scheme based on the NL2 scheme, deriving its
-norm stability. In
Section 4, we conduct numerical experiments to verify the theoretical findings of the proposed scheme. Finally,
Section 5 offers concluding remarks.
3. A Difference Scheme for the TFDE Based on the NL2 Scheme
In this section, we introduce the NL2 scheme for the time-fractional diffusion equation with variable coefficients Equation (
1).
Let
and
be the size of spatial grid and the length of time step, respectively, where
N and
M are positive integers. Define the following spatial and temporal grids:
In the following, we use the notations
Applying the new L2 scheme to discretize the temporal derivative, the TFDE (
1) is written as
where
,
,
and
for
Lemma 2 ([
25])
. Let and , then the following equality holds true: We use the above finite difference method in the spatial direction; then, we construct an NL2 scheme for Equation (
15) with an accuracy of order
.
3.1. The Positive Definiteness of
In this subsection, we study the positive definiteness of the symmetric part of matrix B, equivalently, the positive definiteness of .
Lemma 3 ([
21])
. Given an arbitrary symmetric matrix with positive elements. If S satisfies the following properties:(P1)
(P2)
(P3)
Theorem 2. The matrix is positive definite, and the bilinear form defined byis positive definite. Proof. Let
We split
B as
, where
and
Here,
denotes the Kronecker tensor product of
A and
B: let
, then
. It can be easily checked that
and
The positive definiteness of can be ensured if G and S are both positive definite, where and .
We first consider the symmetric matrix
:
Notice that
For
,
From (
16) and the property (3) of Lemma 1, we have
Combining with
we have
Similarly, by using (
16) and the properties of
,
in Lemma 1, we obtain
Therefore,
G is diagonally dominant with positive diagonal entries, and it follows that
G is positive definite.
Secondly, we prove the positive definiteness of the symmetric matrix by using Lemma 3.
(i) According to Lemma 1, it is easily seen that
S satisfies (P1) of Lemma 3:
(ii) To prove that
S satisfies (P2) of Lemma 3, we need to prove
For
, we have
From (
9)–(
11), we obtain
Since
for
, we have
Moreover, by (
18) and (
19), we obtain
Therefore,
S satisfies (P2) of Lemma 3:
(iii) To prove that
S satisfies (P3) of Lemma 3, we need to prove
For
, it holds
Notice that for fixed
and
,
is a convex function for
, we have
Hence,
It follows that
In the following, we prove that
for
. By using (
9)–(
11), we have
where
We have
We now prove that
It is easy to verify that for
,
Therefore, when
j is odd and
, we have
It is obvious that for
,
. Therefore, when
j is even and
, we have
Therefore, (
24) is correct.
Since
, we have
. Therefore, for
,
and it follows that
Hence, by (
22), (
23), and (
25), we obtain
It follows from (
21) and (
26) that
Finally, we obtain that
S is positive definite from (
17), (
20), and (
27).
Based on the above discussions, we see that
is positive definite. According to (
7) and (
8), we can rewrite
in the following matrix form
It is obvious that
is positive definite. □
3.2. -Stability and Convergence
Based on the consistency and -stability of the NL2 scheme, we can derive the convergence results of the method. In the following discussion, we prove the -norm stability of the scheme by using the positive definiteness of the bilinear form .
Define . represents the continuous norm of x on its domain. In the following, we present the proof of -stability.
Theorem 3. Assume that is a bounded variation function in time and , then the numerical solution () of the NL2 scheme (15) satisfies the following -stabilitywherewith , , and is a constant that depends on . Proof. By multiplying (
15) with
for
, integrating over
, and summing up the derived equations over
terms, we obtain
where
, and
. Applying the Cauchy–Schwarz inequality gives
where
with
and
where the supremum is taken over all finite partitions
of
.
Combining (
28) with (
29) and using the positive definiteness of the bilinear form
(cf. Theorem 2), we obtain
It follows that
By making use of the triangle inequality of the norm:
we have
From (
30) and (
32), we obtain
Combining (
31) and (
33), we obtain
where
. Obviously,
satisfies inequality (
34). Therefore,
which indicates
The proof is completed. □
According to the consistency and
-norm stability properties of the NL2 scheme, we can obtain the convergence result of the proposed method. Let
and
, and define the discrete inner product
and the discrete
-norm
Let the error in the numerical solution at
be defined by
, and let the maximal error of all time steps be defined by
. The following theorem shows that the NL2 scheme has accuracy of order
in time and of order 2 in space.
Theorem 4. Let be the exact solution of problem (1), and be the solution of the NL2 scheme (Equation (15)). Then,where is a positive constant. 4. Numerical Results
In this section, we conduct numerical experiments to validate the theoretical findings discussed in previous sections. In Examples 1 and 2, we demonstrate the accuracy of the NL2 scheme for homogeneous and inhomogeneous boundary conditions, respectively. Then, in Example 3, we compare the numerical results of the NL2 scheme with the L2 schemes proposed in [
17,
20].
Example 1. Consider problem (1) with , , , , and the exact solution Table 1 shows the numerical results for different
’s when
, equivalently,
. It can be seen that the order of the accuracy is about
, which is consistent with the conclusion of Theorem 1.
Table 2 shows numerical results for different
with
. We can see that the order of the accuracy is higher than
. Moreover, compared to
Table 1, we see that for the same
and
,
Table 2 gives more accurate results, which implies that a smaller spatial grid can generate more accurate results. Therefore, we provide results for different
’s with
in
Table 3. Again, we observe that the order of the accuracy is higher than
.
Table 1,
Table 2 and
Table 3 show that for the NL2 scheme, the accuracy order at the final time step may be significantly higher than
. The following
Table 4 shows the maximum
-norm errors over all time steps for different
values with
. It can be seen from
Table 4 that the accuracy order of the NL2 scheme is slightly higher than
.
In the following Example 2, we investigate numerically the accuracy of the NL2 scheme for TFDE with an inhomogeneous boundary condition.
Example 2. Consider problem (1) with , and , and the exact solution is set to As clearly illustrated in
Table 5,
Table 6 and
Table 7, the NL2 scheme is effective to the TFDE with inhomogeneous boundary conditions as well. Moreover, the accuracy order is also about
.
In the following Example 3, we compare the numerical results of the NL2 scheme with the L2 schemes from [
17,
20], denoted as L2(1) and L2(2), respectively. Notice that both coefficients
p and
q are time-dependent.
Example 3. Consider problem (1) with , , , and . The source term f and the initial condition are selected such that the exact solution of the problem is . The error of the numerical solutions and the CPU time (seconds) of the three schemes for Example 3 are summarized in
Table 8 and
Table 9, indicating that the NL2 scheme, the L2(1) scheme, and the L2(2) scheme are stable and convergent. Moreover, the L2(2) scheme often requires the minimal CPU time while the corresponding numerical solution has the largest error. Considering both accuracy and CPU time comprehensively, the NL2 scheme performs the best among the three schemes.
Notably,
Table 10 shows that the maximum
-norm error of the numerical solution of the L2(2) scheme is significantly larger than those of other schemes; see also
Figure 1. It is interesting that if we modify the first step of the L2(2) scheme, that is, replace it by that of the NL2 scheme (we call it the L2(2)* scheme), then the accuracy of the modified scheme L2(2)* is significantly higher than that of the L2(2) scheme in terms of the maximum
-norm; see
Figure 1 and
Figure 2. Therefore, the accuracy of the numerical solution at the first time step has a substantial impact on the accuracy of the numerical solution at subsequent time steps. It can also be observed that the numerical solutions obtained by the NL2 scheme are better than those obtained by the L2(1) scheme, the L2(2) scheme, and the
scheme.